Home >Backend Development >PHP Tutorial >A small example of php recursive call

A small example of php recursive call

WBOY
WBOYOriginal
2016-07-25 09:04:51955browse
  1. /**
  2. * Remove special characters and labels from array elements
  3. */
  4. function delarraystr($array){
  5. if(is_array($array)){
  6. foreach ($array as $k=>$v){
  7. $array[$k] = delarraystr($array[$k]);
  8. }
  9. }else{
  10. $array = strip_tags($array);
  11. $array = preg_replace('/$/', '', $array);//价格梯度1000up
  12. }
  13. return $array;
  14. }
  15. ?>
复制代码


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