Useful functions on PHP5