定义数组,使用函数获取数值老是报错小括号不匹配
代码如下,类中的变量是数组,定义数组的时候,调用到预设变量。老是显示小括号不匹配,怎么解决。
public $thumb_config = array(
'upload_path' => config_item('ThumbPath'),
'allowed_types' => 'gif|jpg|png',
'max_size' => 100,
'max_width' => 1024,
'max_height' => 768,
);
报错
Parse error: syntax error, unexpected '(', expecting ')' in D:\www\antCMS\application\controllers\config\article.php on line 6
陣列內禁止直接呼叫 config_item('ThumbPath')
請在陣列外處理存成一個變數,再放進陣列
页:
[1]