This issue is driving me crazy, could someone please tell whats going wrong with this!? (NOTE: Chances are that it is something really stupid but I can't seem to figure out.)
On a CodeIgniter framework I have a language key like this:
$lang['android'] = array
(
'title' => 'Android apps',
'image_id' => 5,
'description' => 'Learn how to create your own Android app',
'level' => 'Beginner'
);
Then on a view file I load this key like this:
<?php
echo lang($course)['title'];
?>
This works perfectly on localhost, and if $course is 'android' it will print "Android apps". However this very same code does not work on the real server! It simply fails and shows me the error "PHP Parse error: syntax error, unexpected '[', expecting ',' or ';' in [filename]"
Why does this happens? Is it probably a lower PHP version? If so how I could access this array key??
Additional info: Doing a
var_dump('android');
Throws:
array(4) { ["title"]=> string(12) "Android apps" ["image_id"]=> int(5) ["description"]=> string(40) "Learn how to create your own Android app" ["level"]=> string(8) "Beginner" }
Which is the expected value... So why does this happens?