search

Home  >  Q&A  >  body text

Help me see how recursion receives the return value

//Filter HTML tags

function formatString($str){

$preg = "/<\/?[^>] >/i";


## //Determine whether it is an array

if(!is_array($str)){

return preg_replace($preg,'', $ str);

} else {

Foreach ($ Str as $ k = & gt; $ v) {

## // Judging whether the $ v is a multidimensional array

##                                                                                                       using   using using using         use using using ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐                                                                               using   using using using   to use ’       through ’ through ’ using ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ if(is_array($v)) $str[$k][$v] = formatString($v); $preg,'',$v);}

}

## return $str;

}

return $str;

}

逢丿场逢丿场2737 days ago764

reply all(1)I'll reply

  • 逢丿场

    逢丿场2017-08-16 17:22:15

    Solved

    //Filter HTML tags

    function formatString($str){

    $preg = "/</?[^>]+>/i";

    $tree = array() ;


    // Determine whether it is an array

    if(!is_array($str)){

                                                                              ’ ’s ’ ’s ’ s ’ through ’ s ’ ’         out out out out out out out out out out out out out out of  when to  -        -                              foreach ($str as $k=> } else if (! is_array ($ v)) {

    $ tree [$ k] = preg_replace ($ preg, '', $ v);

    }

    reply
    0
  • Cancelreply