标签:for function php object UNC code span type public
废话不多,直接上代码:
<?php class object_array{ //数组转对象 public static function array_to_object($e){ if(gettype($e)!=‘array‘) return; foreach($e as $k=>$v){ if(gettype($v)==‘array‘ || getType($v)==‘object‘) $e[$k]=self::arrayToObject($v); } return (object)$e; } //对象转数组 public static function obj_to_array($e){ $e=(array)$e; foreach($e as $k=>$v){ if(gettype($v)==‘resource‘) return; if(gettype($v)==‘object‘ || gettype($v)==‘array‘) $e[$k]=self:: get_array($v); } return $e; } }
标签:for function php object UNC code span type public
原文地址:https://www.cnblogs.com/wenhainan/p/8908401.html