PHP Filter Two-dimensional array and three-dimensional array, php two-dimensional array _php tutorial

Source: Internet
Author: User

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,...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.