Organizational Research By

Surprising Reserch Topic

how to urlencode and urldecode in php?



asked Sep 13, 2013 in PHP by ashish singh
edited Sep 12, 2013
0 votes
22 views



Related Hot Questions

2 Answers

0 votes

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


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

Output:testing url string

answered Sep 13, 2013 by ashish singh
edited Sep 12, 2013
0 votes

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:

$url="testing url string";
$encodeUrl=urlencode($url);
echo '';
?>

Output:
testing+url+string
">

 

answered Sep 13, 2013 by ashish singh
edited Sep 12, 2013

...