PHP | urldecode() Function Last Updated : 03 May, 2025 Comments Improve Suggest changes Like Article Like Report The urldecode() function is an inbuilt function in PHP which is used to decode url that is encoded by the encode () function. Syntax:string urldecode( $input )Parameters: This function accepts a single parameter $input which holds the url to be decoded. Return Value: This function returns the decoded string on success. Below programs illustrate the urldecode() function in PHP: Program 1: php <?php // PHP program to illustrate urldecode function // all sub domain of geeksforgeeks echo urldecode("https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fpractice.geeksforgeeks.org%2F"). "\n"; echo urldecode("https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fgeeksforgeeks.org%2F"). "\n"; ?> Outputhttps://practice.geeksforgeeks.org/ https://geeksforgeeks.org/ Program 2 : php <?php // all sub domain of geeksforgeeks $url2 = "https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fpractice.geeksforgeeks.org%2F"; $url3 = "https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fgeeksforgeeks.org%2F"; // create an array $query = array($url1, $url2, $url3); // print decoded url foreach ($query as $chunk) { printf(urldecode($chunk). "\n"); } ?> Output https://practice.geeksforgeeks.org/ https://geeksforgeeks.org/ Comment More infoAdvertise with us Next Article PHP | urldecode() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP urlencode() Function The urlencode() function is an inbuilt PHP function used to encode the URL. This function returns a string consisting of all non-alphanumeric characters exceptâ_. It is replaced by the percent (%) sign, followed by two hex digits and spaces encoded as plus (+) signs. Syntax:string urlencode( $input 1 min read PHP | rawurldecode() function The rawurldecode() function is an inbuilt function in PHP which is used to decode the encoded string. This function returns the decoded URL (original URL string) as a string. This function replaces the % sign followed by two hex value with literal characters. Syntax: string rawurldecode( $str ) Para 1 min read PHP | rawurlencode() function The rawurlencode() function is an inbuilt function in PHP which is used to encode the URL(Uniform Resource Locator) according to RFC(Uniform Resource Identifier) 3986. Syntax: string rawurlencode( $str ) Parameters: This function accepts single parameters $str which is mandatory. It is used to store 1 min read PHP ucwords() Function The ucwords() function is a built-in function in PHP and is used to convert the first character of every word in a string to upper-case. Syntax: string ucwords ( $string, $separator ) Parameter: This function accepts two parameters out of which first is compulsory and second is optional. Both of the 2 min read PHP strlen() Function The strlen() is a built-in function in PHP which returns the length of a given string.It calculates the length of the string including all the whitespaces and special characters. Syntax:strlen($string);Parameters: This parameter represents the string whose length is needed to be returned. Return Val 1 min read PHP | show_source() Function The show_source() function is an inbuilt function in PHP which is used to return a file with the PHP syntax highlighted. The syntax is highlighted by using HTML tags. Syntax: show_source( $filename, $return ) Parameters: This function accepts two parameters as mentioned above and described below: $f 2 min read PHP | parse_url() Function The parse_url() function is an inbuilt function in PHP which is used to return the components of a URL by parsing it. It parses an URL and return an associative array which contains its various components. Syntax: parse_url( $url, $component = -1 ) Parameters: This function accepts two parameters as 2 min read PHP mb_strlen() Function The mb_strlen() is an inbuilt PHP function that returns the string length in an integer. Syntax: mb_strlen($string, $encoding ): intParameters: This function accepts 2 parameters that are described below: $string: The string parameter whose lengths need to be determined. It is a required parameter.$ 1 min read PHP | unpack() Function The unpack() function is an inbuilt function in PHP which is used to unpack from a binary string into the respective format. Syntax: array unpack( $format, $data, $offset ) Parameters: This function accepts three parameters as mentioned above and described below: $format: It is required parameter. I 3 min read PHP uniqid( ) Function The uniqid() function in PHP generates a unique identifier based on the current time in microseconds. It creates a string that is highly unlikely to duplicate during execution, making it useful for generating unique tokens, filenames, or session IDs. Optional parameters enhance uniqueness.Syntax uni 3 min read Like