convert array into an object using php

by Guna 2012-07-23 18:45:52

How to create an object from an array? it is really simple, have a look at the following
example.


$arr=array("name"=>"guna");
$arr=(object)($arr);
echo $arr->name; // returns guna.


Simple right?
839
like
0
dislike
0
mail
flag

You must LOGIN to add comments