2017-08-31 40 views
1

時發出的錯誤,我已經使用了some_file.php內郎文件夾內的代碼laravel - json_encodeing反函數的返回值用單引號

return [ 
    'some-text' => 'i\'d like to fix it! it doesn\'t work even if I change the single quotes to double one.', 
]; 

注意,返回的值是正確的,但是當我json_encode的價值並打印它輸入隱藏標記與{!! json_encode('some_file.some_text') !!}它發送給我一個螢火蟲錯誤(我不記得代碼完全,我現在沒有訪問代碼),但它的錯誤間歇json。

回答

0

嘗試雙引號

return [ 
'some-text' => "i\'d like to fix it! it doesn\'t work even if I change 
the single quotes to double one.", 
    ]; 
+0

裏面正如我說,我要麼測試這一項。沒有結果 :( – needcode