to convert simple array to object in PHP . use type conversion by object
see the below example for converting array to object in php
$l=array("a","b","c");
print_r((object)$l); // stdClass Object ( [0] => a [1] => b [2] => c )
object type conversation does not work for multidimensional array to multidimensional object
multidimensional array to multidimensional object example is as below :
$array= array(
"a","b"=>
array("c","b",array("c","a")));
print_r((object)$array); // stdClass Object ( [0] => a [b] => Array ( [0] => c [1] => b [2] => Array ( [0] => c [1] => a ) ) )