php 函数递归调用实例
程序员文章站
2022-05-12 11:11:35
...
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 "
?>
{
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 "
";";
print_r($arr3);
echo "
?>
作者:k7gxn56