首页 > 后端开发 > php教程 > php 读取多维数组方法_PHP教程

php 读取多维数组方法_PHP教程

WBOY
发布: 2016-07-13 10:52:19
原创
1152 人浏览过

php 读取多维数组方法

for($i=0;$i {
for($j=0;$j   {
     echo $array[$j][userid];
  }
}
因为它是个多维数组,一般用
foreach ($arr as $key => $value) {
    echo "Key: $key; Value: $value
\n";
}

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] => ) )

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/632489.htmlTechArticlephp 读取多维数组方法 for($i=0;$icount($array);$i++) { for($j=0;$jcount($array[$i]);$j++) { echo $array[$j][userid]; } } 因为它是个多维数组,一般用 foreach ($arr...
相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板