Some useful functions in PHP