我得到了一个包含 URL 列的数据库。
它的问题是使用我的php代码后,页面给出的结果是我的url http:"//"...
变成了http:"\/\/"...
有什么问题?
最佳答案
那些斜线用于转义 mysql 中的 '
。检索数据后,您可以使用 stripslahes()
删除它们。
$str = "A yellow fish swims in earth\'s oceans."
$str = stripslashes($str);
echo $str; // Outputs A yellow fish swims in earth's oceans.
关于php - 我的 php 代码转换了一些字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37591141/