PHPlist, each function traverses arrays (source code attached)

慕斯
Release: 2023-03-09 19:56:02
Original
1500 people have browsed it

The list function in PHP traverses the array?PHPlist, each function traverses arrays (source code attached)

How to use the list function: list(mixed$ variable 1[, mixed $variablen]), has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

1. How to use the list function list (mixed$ variable 1[, mixed $ variable n]), the code is as follows

'; echo '$three...'.$three.'
'; ?>
Copy after login

It can be seen that the function of list is: the corresponding variable with subscript 0 in the cited array is 1, the corresponding variable with subscript 1 is 2, and so on.

Conclusion:

1: Assign Zhang San with subscript 0 to $one

2: Assign Li with subscript 1 Four is assigned to $two

3: Zhang San with subscript 2 is assigned to $three

. Finally, we get that the function of list is from left to right, --corresponding to the index array Subscript starting from 0;

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of PHPlist, each function traverses arrays (source code attached). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!