Obj.php 230 B

12345678910111213141516
  1. <?php
  2. class Obj{
  3. public static function toArr($arr){
  4. if(is_object($arr)){
  5. $arr = (array)$arr;
  6. }
  7. if(is_array($arr)){
  8. foreach($arr as $key => $val){
  9. $arr[$key] = self::toArr($val);
  10. }
  11. }
  12. return $arr;
  13. }
  14. }