In the actual PHP code, when we need to implement the multivariate array substitution function, we will encounter PHP recursive call. So what is the specific way to use it? Let's look at a sample code to analyze how to implement this function in detail.
PHP recursive invocation implements a multivariate array substitution function code example:
Copy the Code code as follows:
< PHP
$arr = Array ("< small >", "< Xiao Xiao >"), "< little Fly >", "< Xiao li >", "< Little Red >");
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 3 = arrcontentreplact ($arr);
echo "< pre>";
Print_r ($arr 3);
echo "</pre>";
?>
I hope that readers will be able to use the above PHP recursive call to implement the multivariate array substitution function example code, to understand the specific usage.
http://www.bkjia.com/PHPjc/326591.html www.bkjia.com true http://www.bkjia.com/PHPjc/326591.html techarticle in the actual PHP code, when we need to implement the multivariate array substitution function, we will encounter PHP recursive call. So what is the specific way to use it? Below we will pass a generation ...