These functions, rawurlencode() and rawurldecode() are used to encode/decode string as part of a URL. It does this by encoding/decoding every character within the string. When placing text in a query string, it should be distinguished between the query string and the url itself. Encoding and decoding URL also make it safer to send data to a web server.

<?php
echo “<a href=index.php?user=” . rawurlencode($user) . “>”;
?>

<?php
$user=rawurldecode($_GET['user']);
?>