我在文本存储在数据库中的链接有一个非常奇怪的问题:
文字是:
here is the link : <a href=\\"http://www.cnn.com\\">test link</a></p>
在输出或我的html页面中我得到:
here is the link : test link
但是我收到了错误的链接:http://www.example.com/page/view/http://www.cnn.com
我的问题是如何删除我的网站链接并从数据库中获取正确的链接并正确显示它?
答案 0 :(得分:0)
试试这个输出代码:
echo html_entity_decode(stripslashes($string));
问题在于反斜杠。如果没有编辑链接,则href为\“http://www.cnn.com \”,而不是“http://www.cnn.com”,因此浏览器会向其添加网站链接。