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

PHP two-dimensional array to string example_PHP tutorial

WBOY
Release: 2016-07-13 10:25:05
Original
885 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:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template