Maison > Article > développement back-end > php 函数递归调用实例_PHP教程
function arrContentReplact($array)
{
if(is_array($array))
{
foreach($array as $k => $v)
{
$array[$k] = arrContentReplact($array[$k]);
}
}else
{
$array = str_replace(
array(''),
array('{', '}'),
$array
);
}
return $array;
}
$arr = array(array("","",array("",array(""))),"","","");
$arr3 = arrContentReplact($arr);
echo "
";<br>print_r($arr3);<br>echo "";
作者:k7gxn56