1. PHP entry two-dimensional arrays and loops

Source: Internet
Author: User

1<?PHP2 $two=Array(Array(2,3),1=>Array(,2=>)Array(4,5,6));3     Echo $two[1] [0];//Output 14     Echo $two[0] [0];//Output 25     Echo"\ r \ n";6     foreach($two  as $key=$value)//Two-dimensional cyclic output7     {8         Echo $value;9         Echo"\ r \ n";Ten         foreach($value  as $key=$value) One         { A             Echo $value." \ r \ n ";//use + number error -         } -     } the?>

PHP "+" is used as an operation, the result of the operation must be a value, and not like JS inside the "+" number for stitching.
There will be a warning, a non-numeric value encountered, but \ r \ n still works.

1. PHP entry two-dimensional arrays and loops

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.