I have the following variable which returns my URL as needed. But i need to run str_replace() on it to replace a character before echoing it into my HTML code.
我有以下变量,根据需要返回我的URL。但我需要在它上面运行str_replace()来替换一个字符,然后再将它回显到我的HTML代码中。
$url = str_replace("%3A", ":", " . nl2br( $row['url']) . ");
As it stands the " . nl2br( $row['url']) . " contains %3A instead of the colon in the URL and for some reason its rendering my links like this
因为它代表“.nl2br($ row ['url'])。”在URL中包含%3A而不是冒号,并且出于某种原因,它渲染我的链接就像这样
http://www.mydomain.com/http%3A//url.com
1 个解决方案
#1
I'm not really sure what your question is, but it looks like this is what you want:
我不确定你的问题是什么,但看起来这就是你想要的:
$url = urldecode($row['url']);
The %3A is a URL encoded colon (:).
%3A是URL编码的冒号(:)。
#1
I'm not really sure what your question is, but it looks like this is what you want:
我不确定你的问题是什么,但看起来这就是你想要的:
$url = urldecode($row['url']);
The %3A is a URL encoded colon (:).
%3A是URL编码的冒号(:)。