Convert array to object in PHP

a simple way to convert array to object in PHP
[PHP]
0)
{
foreach ($array as $name=>$value)
{
$name = strtolower(trim($name));
if (!empty($name))
{
$object->$name = $value;
}
}
}
return $object;
}
[/PHP]
http://forum.weblivehelp.net/web-development/php-convert-array-object-and-vice-versa-t2.html

Was this article helpful? feel free to make a donation and help keep the blog in the air
PHP

Leave a Reply