标签:multi fun tostring foreach bsp key tin imp class
/** * @method 多维数组转字符串 * @param type $array * @return type $srting * @author yanhuixian */ function arrayToString($arr) { if (is_array($arr)){ return implode(‘,‘, array_map(‘arrayToString‘, $arr)); } return $arr; } /** * @method 多维数组变成一维数组 * @staticvar array $result_array * @param type $array * @return type $array * @author yanhuixian */ function multi2array($array) { static $result_array = array(); foreach ($array as $key => $value) { if (is_array($value)) { array_multi2array($value); } else $result_array[$key] = $value; } return $result_array; }
标签:multi fun tostring foreach bsp key tin imp class
原文地址:https://www.cnblogs.com/sgm4231/p/9821633.html