PHP Filter Two-dimensional array and three-dimensional array, php two-dimensional array array
1
Php2 3 $arr= [4[1,3,5,7,9],5[2,4,6,8,0]6 ];7 $arr 2= [8' List ' = [9[1,3,5,7],Ten[2,4,6,8], One[3,2,9,0], A ] - ]; - $arr 3= [ the' List ' = [ -[1,3,5,7], -[2,4,6,8], -[3,2,9,0] + ] - ]; + A $res=Array_map(function($arr){ at return Array_filter($arr,function($v) { - return $v!== 5; - }); -},$arr); - - $res 2=Array_map(function($val) { in return Array_filter($val,function($v) { - return!In_array(6,$v); to }); +},$arr 2); - the $res 3= []; * Array_walk($arr 3,function($val,$key) Use(&$res 3) { $ $res 3[$key] =Array_filter($val,function($v) {Panax Notoginseng return!In_array(6,$v); - }); the }); + A Var_dump($res 2); the Var_dump($res 3);
http://www.bkjia.com/PHPjc/1109848.html www.bkjia.com true http://www.bkjia.com/PHPjc/1109848.html techarticle PHP Filter Two-dimensional array and three-dimensional array, php two-dimensional array array 1? PHP 2 3 $arr = [4 [1,3,5,7,9], 5 [2,4,6,8,0] 6]; 7 $arr 2 = [8 ' list ' = [9 [1,3,5,7] , ten [2,4,6,8], one [3,2,9,...