What is urlencode() and urldecode() in PHP? urlencode is the PHP function that is used to encode a string that would be used in a query part of a URL. urldecode is the PHP function that is used to decode the query part of a URL. 22-August 9:32 PM 496 Views