PHP Remove % from string in URL

By Game Changer → Saturday, December 5, 2015
PHP accepts request. Sometimes we work with string that should clean. Novice coder often having trouble with it. think you have got a string like that.

Adaptasi%20morfologi%20adalah%20penyesuaian%2E%2E%2E%0D%0A%0D%0A=&onLoad=%5Btype%20Function%5D

(?) Do you need to get a clean output like that:
Adaptasi morfologi adalah penyesuaian... =&onLoad=[type Function]

[Solution]

Use urldecode() function:

<?PHP
$string = "Adaptasi%20morfologi%20adalah%20penyesuaian%2E%2E%2E%0D%0A%0D%0A=&onLoad=%5Btype%20Function%5D";
//$string = $_GET['variable'];
$rString = urldecode($string);
echo $rString;
Sael

I'm Sael. An expert coder and system admin. I enjoy to make codes easy for novice.

Website: fb/Fujael

No Comment to " PHP Remove % from string in URL "