<?php $str = '%2Ftest?a=b&c=d'; var_dump(urldecode($str));var_dump(rawurldecode($str));var_dump(rawurlencode($str));var_dump(strtr($str, [ "&" => "%26", "%2F" => "/"]));
Standard input is empty
string(13) "/test?a=b&c=d" string(13) "/test?a=b&c=d" string(25) "%252Ftest%3Fa%3Db%26c%3Dd" string(15) "/test?a=b%26c=d"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!