how to convert an object to an array with php