PHP | urldecode() Function
The urldecode() function is an inbuilt function in PHP which is used to decode url which is encoded by encoded() function.
Syntax:
string urldecode( $input )
Parameters: This function accepts 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 program to illustrate urldecode function // all sub domain of geeksforgeeks echo urldecode("https%3A%2F%2Fide.geeksforgeeks.org%2F"). "\n"; echo urldecode("https%3A%2F%2Fpractice.geeksforgeeks.org%2F"). "\n"; echo urldecode("https%3A%2F%2Fgeeksforgeeks.org%2F"). "\n"; ?> |
https://ide.geeksforgeeks.org/ https://practice.geeksforgeeks.org/ https://geeksforgeeks.org/
Program 2 :
<?php // all sub domain of geeksforgeeks $url1 = "https%3A%2F%2Fide.geeksforgeeks.org%2F"; $url2 = "https%3A%2F%2Fpractice.geeksforgeeks.org%2F"; $url3 = "https%3A%2F%2Fgeeksforgeeks.org%2F"; // create an array $query = array($url1, $url2, $url3); // print decoded url foreach ($query as $chunk) { printf(urldecode($chunk). "\n"); } ?> |
https://ide.geeksforgeeks.org/ https://practice.geeksforgeeks.org/ https://geeksforgeeks.org/
Reference: http://php.net/manual/en/function.urldecode.php
Recommended Posts:
- How to call a function that return another function in JavaScript ?
- How to get the function name from within that function using JavaScript ?
- PHP | cos( ) Function
- PHP | sin( ) Function
- PHP | tan( ) Function
- p5.js | min() function
- p5.js | red() function
- p5.js | tan() function
- p5.js | sin() function
- PHP | exp() Function
- D3.js | d3.sum() function
- D3.js | d3.mean() function
- p5.js | log() function
- D3.js | d3.min() function
- D3.js | d3.set.has() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : nidhi_biet



