Php reads two-dimensional arrays-PHP source code

Source: Internet
Author: User
Ec (2); php reads a two-dimensional array, which is found today when writing a multi-file upload. here is an example to illustrate. Please refer to the following questions. $ a1 & nbsp; array (a1, a2, a3); $ b2 & nbsp; array (b1, b2, b3); $ B & nbsp; array ($ a1, $ b2); for ($ i0; $ I & lt; sizeof ($ B); $ I ++) {& nbsp; for ($ j0 script ec (2); script

Php reads two-dimensional arrays,I found a problem when I wrote a multi-File Upload File today. Let's give an example to illustrate it. Please refer to the following questions.

$ A1 = array ('a1', 'a2 ', 'a3 ');
$ B2 = array ('b1 ', 'b2', 'b3 ');
$ B = array ($ a1, $ b2 );

For ($ I = 0; $ I
For ($ j = 0; $ j
Echo $ B [$ I] [$ j],'
'; // Print_r ($ B [$ I]); // $ B [$ j];
}
}

Other for statements can also be implemented using foreach. The principles are almost the same.

Original: www.111cn.net

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.