Home > Backend Development > PHP Tutorial > PHP two-dimensional array to string example_PHP tutorial

PHP two-dimensional array to string example_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:25:05
Original
935 people have browsed it

Copy code The code is as follows:

function arr2str ($arr)
{
foreach ($arr as $v)
{
$v = join(",",$v); //You can use implode to convert a one-dimensional array into a comma-connected string
$temp[] = $v ;
}
$t="";
foreach($temp as $v){
$t.="'".$v."'".",";
}
$t=substr($t,0,-1);
return $t;
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/825229.htmlTechArticleCopy the code The code is as follows: function arr2str ($arr) { foreach ($arr as $v) { $v = join(",",$v); //You can use implode to convert a one-dimensional array into a string connected with commas $temp[] = $v; }...
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template