php 数组的用法_PHP教程

WBOY
發布: 2016-07-20 11:00:21
原創
897 人瀏覽過

 

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";
}
($array[$i]);$j++)
($array);$i++)


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/445531.htmlTechArticleArray ( [0] = Array ( [userid] = 1 [username] = 刘振鹏 [status] = 0 [userpwd] = ) [1] = Array ( [userid] = 2 [username] = 刘鹏飞 [status] = 0 [userpwd] = ) [2] = Array ( [use...
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!