Due to work needs, I rewrote such a function based on the example function given in the manual. The code is as follows:
Copy the code The code is as follows:
//Convert all values in the multi-dimensional array into strings————》Supports up to three-dimensional arrays
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 );
}
http://www.bkjia.com/PHPjc/313628.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/313628.htmlTechArticleDue to work needs, I rewrote such a function based on the example function given in the manual. The code is as follows: Copy the code as follows: //Convert all values in the multi-dimensional array...