Difference between urlencode and urldecode

urlencode():- Urlencode can be used to encode a string that can be used in a url. It encodes the same way posted data from web page is encoded. It returns the encoded string.
Example:-

<?php
echo '<a href="test.php?foo=', urlencode($userinput), '">';
?>

urldecode():- this function is used to decode the encoded string.
Example:-

<?php
urldecode($encoded_string);
?>