PHP urlencode() and urldecode()

</p>
<p>&lt;?php</p>
<p> $testString = &quot;This is a test &#8216; with &#8216; several apostrophes&#8217;&quot;;<br />
 echo $testString . &quot;&lt;br /&gt;&quot;; // This is a test &#8216; with &#8216; several apostrophes&#8217;<br />
 $testString = urlencode( $testString );<br />
 echo $testString . &quot;&lt;br /&gt;&quot;; // This+is+a+test+%27+with+%27+several+apostrophes%27<br />
 $testString = urldecode( $testString );<br />
 echo $testString . &quot;&lt;br /&gt;&quot;; // This is a test &#8216; with &#8216; several apostrophes&#8217;<br />
?&gt;</p>
<p>

Tags: ,

Leave a Reply