The following code is giving me errors when run on windows with php version 5.3.5:
$dir_widgets = '/var/www/site-sp/dir1/filename.json';
error here:
$folder_name = array_reverse( explode( '/' , $dir_widgets ) )[ 1 ];
This is the error reported:
*Parse error*: syntax error, unexpected '[' in
On GNU/Ubuntu 13.04 with PHP version 5.4.9 it works fine.
Can be the PHP version? Is it bad practice to do the following?
array_reverse( explode( '/' , $dir_widgets ) )[ 1 ]
Thanks.