How can I test if a string is URL encoded?
Which of the following approaches is better?
What about:
if (urldecode(trim($url)) == trim($url)) { $url_form = 'decoded'; } else { $url_form = 'encoded'; }
Will not work with double encoding but this is out of scope anyway I suppose?