In the version of php-5.3.21, the script does not work - syntax error unexpected [, expecting )
, in later versions it works. How to fix?
<?php $key = 'key'; $url = 'url'; echo json_encode([ //ошибка тут 'initialPreview' => ["<img style='height:160px' src='http://path.to.uploaded.file/{$key}.jpg' class='file-preview-image'>",], 'initialPreviewConfig' => [['caption' => "Architecture-{$key}.jpg", 'width' => '120px', 'url' => $url, 'key' => $key],], 'append' => true]); ?>