
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
URL Decoding in PHP
URL decoding can be done using the built-in 'urldecode' function. This returns the encoded data.
Syntax of urldecode function
string urldecode($input)
It takes a single parameter ($input) which is the URL that is to be decoded. Returns the decoded string provided the decoding was successful −
Example
<?php echo urldecode("https%3A%2F%2F2.zoppoz.workers.dev%3A443%2Fhttps%2Fmedium.com%2F"). "
"; ?>
In the above lines of the code, the ‘urldecode’ function takes in the raw (encoded string) and returns the decoded value of the string.
Output
This will produce the following output −
https://medium.com/
Advertisements