首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

如何出错了呢?求原理

2013-06-25 
怎么出错了呢?求原理本帖最后由 abu_sec 于 2013-05-21 14:26:40 编辑?php$colors array(redhongs

怎么出错了呢?求原理
本帖最后由 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";
}

热点排行