この未終了の文字列リテラルエラーを修正するにはどうすればよいですか。このエラーの意味と修正方法
以下は完全なコードです:
<?php
session_start();
if(isset($_POST['fileImage'])){
$idx = count($_POST ['fileImage']) -1 ;
$output = isset($_POST ['fileImage'][$idx]) ? $_POST ['fileImage'][$idx]['name'] : "";
}
?>
function stopImageUpload(success) {
var imageNameArray = ['<?php echo json_encode($output); ?>'];
var result = '';
if (success == 1) {
result = '<span class="msg">The file was uploaded successfully!</span><br/><br/>';
for (var i = 0; i < imageNameArray.length; i++) {
$('.listImage').append(imageNameArray[i] + '<br/>');
}
}
else {
result = '<span class="emsg">There was an error during file upload!</span><br/><br/>';
}
return true;
}