Useful functions for arrays in PHP