<?php$config=array("type"=>'{"category":"admin","page":"page"}',"say"=>"Hello","php"=>array("say"=>"no","type"=>'{"category":"admin","page":"page"}',"gran"=>array("name"=>"Hi")));classobjectify{publicfunctionjson_to_array($array,$recursive=true){# if $array is not an array, let's make it array with one value of former $array.if(!is_array($array))$array=array($array);foreach($arrayas$key=>$value){if($recursive===false){$array[$key]=(!empty($value)&&is_string($value)&&json_decode($value)!=NULL)?json_decode($value,true):$value;}else{$array[$key]=(!empty($value)&&is_string($value)&&json_decode($value)!=NULL)?json_decode($value,true):(is_array($value)?self::json_to_array($value):$value);}}return$array;}}$object=newobjectify();$config=$object->json_to_array($config);print_r($config);