时间:2021-07-01 10:21:17 帮助过:29人阅读
//将多维数组中所有的数值转换成字符串————》最多支持三维数组
function implodex( $glue, $array, $separator='' ) {
if ( ! is_array( $array ) ) return $array;
$string = array();
$count = 0;
foreach ( $array as $key => $val ) {
if ( is_array( $val ) )
$val = implode( $glue, $val );
if($count == 0){
$string[] = "{$val}";
}else{
$string[] = "{$glue}{$val}";
}
}
if(empty($separator))$separator = $glue;
return implode( $separator, $string );
}