Useful functions in PHP