Example of converting a two-dimensional php array into a string. Copy the code as follows: functionarr2str ($ arr) {foreach ($ arras $ v) {$ vjoin (, $ v ); you can use implode to convert a one-dimensional array to a comma-connected string $ temp [] $ v ;}
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 to a string connected with commas (,).
$ Temp [] = $ v;
}
$ T = "";
Foreach ($ temp as $ v ){
$ T. = "'". $ v ."'".",";
}
$ T = substr ($ t, 0,-1 );
Return $ t;
}
The http://www.bkjia.com/PHPjc/825229.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/825229.htmlTechArticle code is as follows: function arr2str ($ arr) {foreach ($ arr as $ v) {$ v = join (",", $ v ); // you can use implode to convert a one-dimensional array to a comma-connected string $ temp [] = $ v ;}...