Home> php教程> php手册> body text

遍历关联数组

WBOY
Release: 2016-06-06 19:34:43
Original
1221 people have browsed it

遍历关联数组 无 $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].'
'; next($arr); } // 注意:只能遍历关联数组
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!