Home >php教程 >php手册 >php 函数递归调用实例

php 函数递归调用实例

WBOY
WBOYOriginal
2016-06-13 11:36:451500browse


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

Statement:
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