将输入保存到数据库时出现问题。
我将字符串另存为:
mysql_real_escape_string($my_string)
然后,我阅读并使用以下命令将字符串放置到输入中:
stripslashes($my_string)
关键是,如果我在字符串中设置双斜杠,则输入将崩溃,如下所示:
<input maxlength = "150" type="text" name = "my_string12" value = "hello "this is" a test" class="input-medium"/>
谢谢。
最佳答案
如果将值作为PHP变量,则必须对其进行修剪..
使用修剪功能:
$str = 'hello "this is" a test';
echo trim($str, '"'); // hello this is a test
保罗在here回答
关于php - 读取斜线输入崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16373648/