I want to sort the properties of an object so that I can scroll them in a specific order.
for example: I have a "book" of an object with the following properties: "id", "title", "author", "date".
Now I want to skip these properties as follows:
foreach($book as $prop=>$val)
now the loop order should be "title", then "author", "date" and "id"
How to do it? (I cannot change the order of the properties in the class of the object, because there are any properties defined there, I get the object from the database using "MyActiveRecord")
source share