Home > Backend Development > PHP Tutorial > How to use php array_PHP tutorial

How to use php array_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-20 11:00:21
Original
941 people have browsed it

Array ( [0] => Array ( [userid] => 1 [username] => Liu Zhenpeng [status] => 0 [userpwd] => ) [1] => Array ( [ userid] => 2 [username] => Liu Pengfei [status] => 0 [userpwd] => ) [2] => Array ( [userid] => 3 [username] => Liu Peng [status] => 0 [userpwd] => ) [3] => Array ( [userid] => 4 [username] => admin [status] => 0 [userpwd] => ) [4] => Array ( [userid] => 11 [username] => admin [status] => 0 [userpwd] => ) [5] => Array ( [userid] => 12 [username] => admin [status] => 0 [userpwd] => ) [6] => Array ( [userid] => 13 [username] => liuzp [status] => 0 [userpwd] => ) [7] => Array ( [userid] => 14 [username] => lzp [status] => 0 [userpwd] => ) )

The following is the usage of two-dimensional array
for($i=0;$i{
for($j=0;$j {
echo $array[$j][userid];
}
}
Because it is a multi-dimensional array, generally use
foreach ($arr as $key => $value) {
echo "Key: $key; Value: $value
n";
}
($array[$i]);$j++)
($array);$i++)


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445531.htmlTechArticleArray ( [0] = Array ( [userid] = 1 [username] = Liu Zhenpeng [status] = 0 [ userpwd] = ) [1] = Array ( [userid] = 2 [username] = Liu Pengfei [status] = 0 [userpwd] = ) [2] = Array ( [use...
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 Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template