I am building an web app with php and built it in php 5.4. However, I just realized my server run only 5.3 or 5.2. In my controller file I have this line of code
$this->load->model('admin/upholstery_category_admin');
$this->load->helper('url');
if($method == 'add')
{
$categories = $this->db->get('category')->result();
line 158 here>> $data = [];
$data['cats'] = $categories;
$data['message'] = '';
which is causes this error
Parse error: syntax error, unexpected '[' in /home/content/51/6663351/html/application/controllers/admin.php on line 158
How do i change the syntax to correct this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…