Encoding and Decoding URL Strings in PHP


Use urlencode() and urldecode() to encode and decode URL strings.

Source Code

$encoded = urlencode("This is a test!");
echo $encoded; // Outputs: This+is+a+test%21
echo urldecode($encoded); // Outputs: This is a test!
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments