0
点赞
收藏
分享

微信扫一扫

php 数组根据元素分割成新的数组

凶猛的小白兔 2022-02-20 阅读 174
$newArr=[];
$tmp=[];
foreach ($arr as $row){
        if(!strstr($row,'059')){
            array_push($tmp,$row);
            /*echo "<pre>";
            var_dump($tmp);exit;*/
        }else{
            //array_push($tmp,$row);
            //echo "<pre>";
            //var_dump($tmp);
            array_push($newArr,$tmp);
            $tmp=[];
        }
    }
举报

相关推荐

0 条评论