0
,所以我有這個變量語法錯誤:標識符數字文字,str_replace函數變量之後立即開始爲JavaScript
$number = "1944/UN31/KEP/2017"
的話,我想更換"/"
到""
,所以我創造新的變量:
$number2 = str_replace("/","",$number) // the result would be : 1944UN31KEP2017
我可以在使用之前(在laravel blade中)訪問我的$ number變量給js:
onClick="doPrintTxtdaftar({{ $number}});">Print</a>
但是當我更換字符串和第二變量:
onClick="doPrintTxtdaftar({{ $number2}});">Print</a>
我在我的debuger一個錯誤說:語法錯誤:1944UN31KEP2017
:標識後數字文字其指出我的第二varable值立即開始
有人可以幫我...謝謝
它的作品就像一個魅力。謝謝 –
@ www.cahyonegoro.com格萊德,我的答案爲你工作...乾杯隊友 –