088-PHP数组运用 - 通过循环函数过滤部分数组
2020-12-12 22:56
阅读:414
标签:++ span 定义 print 自定义 set fun mic 部分
php function myfunc(&$arr){ //自定义一个过滤函数 $j=count($arr); for($i=0;$i$j;$i++){ if($arr[$i]%2==0) unset($arr[$i]); } } $arr=array(23,14,37,263,244,379,100,153,150); //定义一个数组 echo ‘数组进行过滤之前的信息:
‘; print_r($arr); myfunc($arr); //调用自定义函数 echo ‘
数组进行过滤之后的信息:
‘; print_r($arr); ?>
088-PHP数组运用 - 通过循环函数过滤部分数组
标签:++ span 定义 print 自定义 set fun mic 部分
原文地址:https://www.cnblogs.com/tianpan2019/p/11001530.html
上一篇:CSS浮动
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:088-PHP数组运用 - 通过循环函数过滤部分数组
文章链接:http://soscw.com/index.php/essay/23730.html
文章标题:088-PHP数组运用 - 通过循环函数过滤部分数组
文章链接:http://soscw.com/index.php/essay/23730.html
评论
亲,登录后才可以留言!