解析错误:语法错误,意外' ['第149行

时间:2014-07-19 22:50:14

标签: php parsing line

我有这个错误。这是我的代码。你能帮我吗? ??? ? ?第149行是最后一行:(

    $customer_group_info = $this->model_sale_customer_group->getCustomerGroup($order_info['customer_group_id']);

    if ($customer_group_info) {
        $this->data['customer_group'] = $customer_group_info['name'];
    } else {
        $this->data['customer_group'] = '';
    }

    $this->load->model('localisation/order_status');
    $this->data['order_status'] = $this->model_localisation_order_status->getOrderStatus($order_info['order_status_id'])['name'];

1 个答案:

答案 0 :(得分:1)

哟可以使用返回数组的函数直接使用它的结果。 您必须将结果绑定到变量,然后使用它。

$temp = $this->model_localisation_order_status->getOrderStatus($order_info['order_status_id']);
$this->data['order_status'] = $temp['name'];

编辑:Access an Array Returned by a Function

的副本