Preventing double encode of URL in PHP

1 · Subin Siby · July 22, 2013, 3:30 a.m.
There is no practical way to check whether an URL is encoded or not to encode if it’s not encoded. But you can do encode the URL by first decoding like below: $string = url_decode($url); And then you should encode as to prevent double encoding. $string = url_encode($url); By doing this we can prevent double encoding of URL‘s....