php foreach循环的问题,一直循环两次(将两种索引都检索一遍)…………
foreach($temp_authorityas$key=>$value){$_SESSION[$key]=$value;echo"thisiskey:".$key."...
foreach ($temp_authority as $key => $value) {
$_SESSION[$key] = $value;
echo "this is key :".$key." and this is value : ".$value." ;<br/> ";
$i++;
}
echo 是我用来进行输出验证的,然后得到了如下结果(在网页里面显示形式):
this is key :0 and this is value : 10 ;
this is key :ID and this is value : 10 ;
this is key :1 and this is value : super ;
this is key :charactor and this is value : super ;
this is key :2 and this is value : 9 ;
this is key :check_in and this is value : 9 ;
this is key :3 and this is value : 9 ;
this is key :elder_manage and this is value : 9 ;
this is key :4 and this is value : 9 ;
this is key :charge and this is value : 9 ;
this is key :5 and this is value : 9 ;
this is key :assistant and this is value : 9 ;
this is key :6 and this is value : 9 ;
this is key :clerk_manage and this is value : 9 ;
this is key :7 and this is value : 9 ;
this is key :warehoust and this is value : 9 ;
this is key :8 and this is value : 9 ;
this is key :meals and this is value : 9 ;
this is key :9 and this is value : 9 ;
this is key :specialsevice and this is value : 9 ;
this is key :10 and this is value : 9 ;
this is key :datas and this is value : 9 ;
this is key :11 and this is value : 9 ;
this is key :room_manage and this is value : 9 ;
this is key :12 and this is value : 9 ;
this is key :system and this is value : 9 ; 展开
$_SESSION[$key] = $value;
echo "this is key :".$key." and this is value : ".$value." ;<br/> ";
$i++;
}
echo 是我用来进行输出验证的,然后得到了如下结果(在网页里面显示形式):
this is key :0 and this is value : 10 ;
this is key :ID and this is value : 10 ;
this is key :1 and this is value : super ;
this is key :charactor and this is value : super ;
this is key :2 and this is value : 9 ;
this is key :check_in and this is value : 9 ;
this is key :3 and this is value : 9 ;
this is key :elder_manage and this is value : 9 ;
this is key :4 and this is value : 9 ;
this is key :charge and this is value : 9 ;
this is key :5 and this is value : 9 ;
this is key :assistant and this is value : 9 ;
this is key :6 and this is value : 9 ;
this is key :clerk_manage and this is value : 9 ;
this is key :7 and this is value : 9 ;
this is key :warehoust and this is value : 9 ;
this is key :8 and this is value : 9 ;
this is key :meals and this is value : 9 ;
this is key :9 and this is value : 9 ;
this is key :specialsevice and this is value : 9 ;
this is key :10 and this is value : 9 ;
this is key :datas and this is value : 9 ;
this is key :11 and this is value : 9 ;
this is key :room_manage and this is value : 9 ;
this is key :12 and this is value : 9 ;
this is key :system and this is value : 9 ; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询