I have a string:
$fonts = "Arial:400";
When I use that in a URL, the colon prints as %3A. How can I escape the colon so that it prints as :? I have tried preg_replace and urlencode with no luck. I'm sure its simple but I have searched.
:
You should be using urlencode and substitute the %3a with :
$url = urlencode($url); $url = str_replace("%3A",":",$url);
2.1m questions
2.1m answers
60 comments
57.0k users