Fastest way to Convert Associative Arrays to Objects
Simply cast an Associative array:
$obj = (object) array('animal' => 'dog', 'name' => 'simon');
// Then you can access values as objects:
echo $obj->animal; // Outputs dog
echo $obj->name; // Outputs simon
No need to create a class or Function to accomplish it.
Do you need help with a project? or have a new project in mind that you need help with?Contact Me