PHP data type parsing and manipulation