試圖讓HTML代碼使用回聲工作表單輸入,回聲反斜槓
這個工程爲html:
<input type="text" name="ordernum" value="<?= isset($_POST['ordernum']) ? htmlspecialchars($_POST['ordernum']) : '' ?>" />
但是當我轉義反斜線值(我曾經嘗試幾十個組合和閱讀很多在stackoverflow,但仍然不能解決它)我得到意想不到的T_STRING錯誤。
echo ' <input type="text" name="ordernum" value=\'= isset($_POST['ordernum']) ? htmlspecialchars($_POST['ordernum']) : '' \' />';
你不能只寫任意P HP代碼*位於字符串文字*的中間。 – Quentin