PHP Custom Urlencode,urldecode function instance, Urlencodeurldecode
This example describes the PHP custom Urlencode,urldecode function. Share to everyone for your reference. Specific as follows:
With JavaScript's Ajaxobject function, the string is transcoded. function Ajax_encode ($str) { $patern = array ("/%/", "/=/", "/&/"); The% must be the first item, and the substitution is done in the order of the items. $RP = Array ("%25", "%26", "%3d"); Return Preg_replace ($patern, $RP, $str);} Inverse function Ajax_decode ($str) { $patern = array ("/%25/", "/%26/", "/%3d/"); $RP = Array ("%", "=", "&"); Return Preg_replace ($patern, $RP, $str);}
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/972634.html www.bkjia.com true http://www.bkjia.com/PHPjc/972634.html techarticle PHP Custom Urlencode,urldecode function instance, Urlencodeurldecode This example describes the PHP custom Urlencode,urldecode function. Share to everyone for your reference. Specific as follows:/...