0

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("%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

http://www.mydomain.com/http%3A//url.com

1 Answer 1

3

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 (:).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.