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 shewale Tutorials";
$encodeUrl=urlencode($url);
echo '<a href="test.php?sample=$encodeUrl">';
?>
Output: <a href="test.php?sample=Rajesh+shewale+Tutorials">
urldecode :- Returns the decoded string.(Returns the original string of the input URL).
<?php
$sample=$_GET["sample"];
echo $sample=urldecode($sample);
?>
Output:Rajesh shewale Tutorials
Similar Questions:
php urlencode() and urldecode() function
urlencode() function.
urldecode() function.
PHP's urlencode() and urldecode() functions.
urlencode() in
urlencode in php