Tips on PHP recursive calls

  • 2020-05-30 19:30:06
  • OfStack

In the actual encoding of PHP, when we need to implement the multiarray substitution function, we will encounter a recursive call to PHP. So how do you use it? Below we will use a code sample to analyze the method of implementing this function in detail.

Example code of PHP recursive call to implement multiple array replacement function:

< ?php   
$arr = array(array("<  pika~chu >","<  Small xiao >"),"<  Small fly >","<  Xiao li >","<  The little red >");   
function arrContentReplact($array)   
foreach($array as $k => $v)   
$array[$k] = arrContentReplact($array[$k]);   
$array = str_replace(array('<', '>'),
 array('{', '}'), $array);   
return $array;   
$arr3 = arrContentReplact($arr);   
echo "< pre>";   
echo "< /pre>";   

We hope you will find out how to use the example code above for the PHP recursive call to implement multiarray substitution.

Related articles: