首頁 >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