Copy CodeThe code is as follows:
/*
* ————————————————-
* @file: 5.php
* @function: Arr2str
* @copyright: 2002-2009 Xingmo INC
* @author: Fanglor
* @date: 2010-06-25
* @update:
* ————————————————-
*/
$fruits = Array (
"Fruits" = Array ("A" and "Orange", "B" and "Banana", "c" = "apple"),
"Numbers" = = Array (1, 2, 3, 4, 5, 6),
"holes" = = Array ("First", 5 = "Second", "third")
);
$arr 1 = Array (1, 2, 3, 4, 5, 6=> ' Fanglor ');
function Arr2str ($arr)
{
static $res _arr = Array ();
if (Is_array ($arr))
{
foreach ($arr as $key = $val)
{
if (Is_array ($val))
{
Arr2str ($val);
}
Else
{
$res _arr[] = $val;
}
}
}
ElseIf (is_string ($arr))
{
$res _arr[] = $arr;
}
Return implode (', ', $res _arr);
}
$str = Arr2str ($arr 1);
Print_r ($STR);
?>
http://www.bkjia.com/PHPjc/322304.html www.bkjia.com true http://www.bkjia.com/PHPjc/322304.html techarticle Copy the code as follows:/* * ————————————————-* @file: 5.php * @function: Arr2str * @copyright: 2002-2009 Xingmo Inc * @author : Fanglor Fang ...