array ( [0] => array ( [userid] => 1 [username] => 刘振鹏 [status] => 0 [userpwd] => ) [1] => array ( [userid] => 2 [username] => 刘鹏飞 [status] => 0 [userpwd] => ) [2] => array ( [userid] => 3 [username] => 刘朋 [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] => ) )
下面是对二维数组的用法
for($i=0;$i
for($j=0;$j
echo $array[$j][userid];
}
}
因为它是个多维数组,一般用
foreach ($arr as $key => $value) {
echo "Key: $key; Value: $value
n";
}
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号