A PHP file is receiving a URL encoded string via GET. However, some scripts may send strings encoded with the urlencode()
function, while other scripts may send strings encoded with the rawurlencode()
function.
What would be the best way to check which function was used to encode the string, so the appropriate decoding function (urldecode()
or rawurldecode()
) can be called?
So far, my only idea is code like this:
if (stristr($string, "%20"))...