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 | 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 mb_strtolower() Function The mb_strtolower() is a PHP inbuilt function that returns lowercase alphanumeric characters. Syntax: mb_strtolower(string $string, ?string $encoding = null): stringParameters: This function accepts 2 parameters: string: This parameter specifies the lowercase string.encoding: This parameter denotes 1 min read PHP | random_bytes () Function The random_bytes()is an inbuilt function in PHP. The main function is to generate cryptographically secure pseudo-random bytes. It generates cryptographic random bytes of arbitrary string length. The different sources of randomness used in this function, they are as follows:- Window : CryptGenRandom 1 min read PHP String Functions Strings are a fundamental data type in PHP, used to store and manipulate text. PHP provides a wide variety of built-in string functions. These functions perform various operations such as string transformations, character manipulations, encoding and decoding, and formatting, making string handling s 6 min read PHP mb_eregi_replace() Function The mb_eregi_replace() is an inbuilt function in PHP that is used to perform the replacement of regular expression characters. It is a case-insensitive regular expression search and replace with multi-byte character support. Syntax: mb_eregi_replace( string $pattern, string $replacement, string $str 2 min read PHP mb_scrub() Function The mb_scrub() is an inbuilt PHP function that replaces an invalid character set to the substitute character. If the encoding is not provided. It will use default encoding. Syntax: mb_scrub($string, $encoding ); Parameters: This function accepts two parameters that are described below. $string: The 1 min read Like