经常会有人问我, PHP的数组, 如果用foreach来访问, 遍历的顺序是固定的么? 以什么顺序遍历呢? 比如:
<?php $arr[2] = 'huixinchen'; $arr[1] = 2007; $arr[0] = 2008; foreach ($arr as $key => $val) { //结果是什么? }
要完全了解清楚这个问题, 我想首先应该要大家了解PHP数组的内部实现结构………
PHP开发组成员, PECL开发者, 曾供职于雅虎, 现就职百度.
Apache browser bug C++ charset COOKIE core c写PHP扩展 debug encoding engine Extension GET IE javascript js json Module mysql namespace nginx PHP php5.4 PHP5.4新特性 PHP extension php原理 PHP应用 PHP扩展 php源码 php源码分析 SAPI session utf8 variable vim Yaf Zend/PHP 乱码 作用域 原理 开发php扩展 性能 扩展PHP 扩展开发 正则 GNU C/C++ (3) Js/CSS (24) Linux/Unix (15) MySQL/PostgreSQL (7) PHP Extension (13) PHP应用 (139) PHP源码分析 (73) 转载 (30) 随笔 (68)
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.