Test if string is URL encoded in PHP
问题 How can I test if a string is URL encoded? Which of the following approaches is better? Search the string for characters which would be encoded, which aren't, and if any exist then its not encoded, or Use something like this which I've made: function is_urlEncoded($string){ $test_string = $string; while(urldecode($test_string) != $test_string){ $test_string = urldecode($test_string); } return (urlencode($test_string) == $string)?True:False; } $t = "Hello World > how are you?"; if(is