CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of escape
<?php
 
/*php提供的URL编码函数是基于字节的对由ie的javascript函数escape编码的数据就无能为力了。*/
 
function escape($str) {
    preg_match_all("/[\x80-\xff].|[\x01-\x7f]+/", $str, $r);
    $ar = $r[0];
    foreach($ar as $k=>$v) {
        if(ord($v[0]) < 128)
            $ar[$k] = rawurlencode($v);
by clark   August 01, 2011 @ 4:04am
140 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate