Utility methods for different data types in PHP