首页 >php教程 >php手册 >遍历关联数组

遍历关联数组

WBOY
WBOY原创
2016-06-06 19:34:431306浏览

遍历关联数组 无 $arr=array('id'='2','friendship'='Your life is too valuable to throw away','comes'=' I\'m gonna say yes--yes to love','num'=563,'make'='make up our minds to take the world as we find it');while($key=key($arr)){echo $key.'---

遍历关联数组
$arr=array('id'=>'2','friendship'=>'Your life is too valuable to throw away','comes'=>' I\'m gonna say yes--yes to love','num'=>563,'make'=>'make up our minds to take the world as we find it');

while($key=key($arr))
{
	echo $key.'---'.$arr[$key].'<br>';
	next($arr);
}

//  注意:只能遍历关联数组
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn