首页 >后端开发 >php教程 >php 函数递归调用实例_PHP教程

php 函数递归调用实例_PHP教程

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-07-21 14:54:111152浏览


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

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/364658.htmlTechArticle?php function arrContentReplact($array) { if(is_array($array)) { foreach($array as $k = $v) { $array[$k] = arrContentReplact($array[$k]); } }else { $array = str_replace( array('',...
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn