Convert associative array to object. Yii style.

Is there something built in like this?





$my_array = array("id"=>100, "messages"=>array("hello world"));


$my_obj = Yii::funkyConvertArrayToStdObj($my_array);


echo $my_obj->id;  // returns string or int.

print_r($my_obj->messages); // returns array of messages.




Thanks

maybe this will help you

Excellent >:D

Thanks

Actually, type casting it to an object does the job too.


e.g. (object)my_array;