Posted By

built2fall on 01/21/10


Tagged

php object array convert cast


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

netzwerktourist


Convert Array to Object


 / Published in: PHP
 

  1. // Converts an array to an object
  2. function array2obj($data)
  3. {
  4. return is_array($data) ? (object) array_map(__FUNCTION__,$data) : $data;
  5. }

Report this snippet  

You need to login to post a comment.