urlencode :-Returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs.

Syntax:
string urlencode ( string $str );

Example:
<?php
$url="Rajesh SharmaTutorials";
$encodeUrl=urlencode($url);
echo '<a href="test.php?sample=$encodeUrl">';
?>

Output: <a href="test.php?sample=Rajesh+Sharma+Tutorials">

urldecode :- Returns the decoded string.(Returns the original string of the input URL).

<?php
$sample=$_GET["sample"];
 echo $sample=urldecode($sample);
?>

Output:Rajesh SharmaTutorials