PHP数组中的解析错误

时间:2011-01-25 12:12:01

标签: php arrays syntax-error

    $labels = (
        'steam' => 'Steam',
        'bore_water' => 'Bore Water',
        'boiler1oil' => 'Boiler 1 Oil',
    );
  

解析错误:语法错误,第32行意外T_DOUBLE_ARROW'steam' => 'Steam',

有人能发现这个问题吗?

2 个答案:

答案 0 :(得分:4)

$labels = array(
    'steam' => 'Steam',
    'bore_water' => 'Bore Water',
    'boiler1oil' => 'Boiler 1 Oil',
);

答案 1 :(得分:3)

您遗失array

$labels = array(
    'steam' => 'Steam',
    'bore_water' => 'Bore Water',
    'boiler1oil' => 'Boiler 1 Oil',
);