PHP
Chilkat2 PHP
URL Encoding and Decoding
Demonstrates URL encoding/decoding using the HTTP convenience methods.Chilkat PHP Downloads
<?php
use Chilkat2\Http;
$http = new Http();
$s = 'Hello World! 100% sure.';
$encoded = $http->UrlEncode($s);
echo 'URL encoded: ', $encoded, "\n";
// Space → %20
// ! → %21
// % → %25
$decoded = $http->UrlDecode($encoded);
echo 'URL decoded: ', $decoded, "\n";
// Output:
// URL encoded: Hello%20World%21%20100%25%20sure.
// URL decoded: Hello World! 100% sure.