Home  >  Article  >  Backend Development  >  php 数组,该如何解决

php 数组,该如何解决

WBOY
WBOYOriginal
2016-06-13 11:49:59930browse

php 数组
$nav_user=$this->obj->DB_select_alls("admin_user","admin_user_group","a.`m_id`=b.`id` and a.`uid`='".$_SESSION["auid"]."'");
if($nav_user[0][domain]!="")
{
    $domain_arr=$nav_user[0][domain];
}
里面调用的方法不管它,我想知道像$nav_user[0][domain]这种[][]写法是什么意思?
------解决方案--------------------
二维数组的成员

你用的方法是 DB_select_alls
通常含有 all 的方法名都是返回全部结果,何况他还是 alls (复数)
------解决方案--------------------

$arr = array('0'=>array('domain'=>'www.baidu.com'),'1'=>array('domain'=>'www.google.com'));<br />echo $arr[0]['domain'];

$arr[0]['domain'] []里面的值都是表示键值 数组的取值通过获取数组的键值指向某个值的
------解决方案--------------------
是一个二维数组,
$arr[0]['domain']表示数组的第一个成员的domain键值

Statement:
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