//二维数组转字符串 public function arr_to_str($arr){ foreach ($arr as $v){ $v = join(",",$v); //可以用implode将一维数组转换为用逗号连接的字符串,join是别名 $temp[] = $v; } foreach($temp as $v){ $t.=$v.","; } $t=substr($t,0,-1); //利用字符串截取函数消除最后一个逗号 return $t; }
时间: 2024-09-29 02:56:13