Query String Not Working with colons

How to replace dot (.) and colon (:slight_smile: with dash (-) using preg_replace function??

what have you tried?

PS. why using a preg_replace() for something you could do much easier with str_replace()?

Actually i am hung up on some point i am getting some values from a page to another page using $_GET …but values with colons are not working well … It says url could not be found.

You may have noticed some URLs that have %20 in them before? eg.
http://example.com/some%20awesome%20article

That’s because an article named “some awesome article” would beak things if used as part of a URL because of the spaces.

You could use PHP to do a replace. but IMHO it would be easier to use rawurlencode
http://php.net/manual/en/function.rawurlencode.php

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.