当前位置: 代码迷 >> PHP >> 如何出错了呢?求原理
  详细解决方案

如何出错了呢?求原理

热度:97   发布时间:2016-04-28 21:17:29.0
怎么出错了呢?求原理
本帖最后由 abu_sec 于 2013-05-21 14:26:40 编辑
<?php
$colors = array('red'=>'hongse', 'blue'=>'lanse', 'green'=>'lvse', 'yellow'=>'huangse');

foreach ($colors as $color) {
   echo "Do you like $color['red']?\n";
?>

------解决方案--------------------

$colors = array('red'=>'hongse', 'blue'=>'lanse', 'green'=>'lvse', 'yellow'=>'huangse');

foreach ($colors as $color) {
   echo "Do you like $color?\n";
}
  相关解决方案