php urlencode()
ÔÚPHPÖÐÓÐurlencode()¡¢urldecode()¡¢rawurlencode()¡¢rawurldecode()ÕâЩº¯ÊýÀ´½â¾öÍøÒ³
URL±àÂë½âÂëÎÊÌâ¡£
ÔÚASPµÄʱºòURL±àÂë½âÂëºÜÊÇÄÕ»ð£¬Server.urlencode²»Ì«ºÃÓã¬Óöµ½utf-8±àÂëµÄµØÖ·¸üÊÇÂé
·³¡£ÄãÒª»ñÈ¡°Ù¶È¡¢Googleµã»÷µ½ÍøÕ¾µÄÍøÖ·Á´½ÓÖеĹؼü×Ö£¬ÒªÐ´ÉÏÒ»¶Ñ×Ô¶¨Ò庯ÊýÀ´µÃµ½urldecodeµÄЧ¹û¡£
ժ¼һƪ¹ØÓÚ
PHP urlencode()º¯ÊýµÄÎÄÕ£¬¶ÔPHP´¦ÀíURL×÷È«ÃæÁ˽⣬ÎÄÕÂÀ´×Ô373renÅÅÐÐ13£¬¸Ðл¡£
Àí½â
urlencode
£º
urlencode£ºÊÇÖ¸Õë¶ÔÍøÒ³urlÖеÄÖÐÎÄ×Ö·ûµÄÒ»ÖÖ±àÂëת»¯·½Ê½£¬×î³£¼ûµÄ¾ÍÊÇBaidu¡¢
GoogleµÈËÑË÷ÒýÇæÖÐÊäÈëÖÐÎIJéѯʱºò£¬Éú³É¾¹ý
Encode¹ýµÄÍøÒ³URL¡£urlencodeµÄ·½Ê½Ò»°ãÓÐÁ½ÖÖÒ»ÖÖÊÇ´«Í³µÄ»ùÓÚGB2312µÄEncode£¨Baidu¡¢YisouµÈʹÓã©£¬Ò»ÖÖÊÇ
»ùÓÚutf-8µÄEncode(Google,YahooµÈʹÓÃ)¡£±¾¹¤¾ß·Ö±ðʵÏÖÁ½ÖÖ·½Ê½µÄEncodeÓëDecode¡£
ÖÐÎÄ
-> GB2312µÄEncode -> %D6%D0%CE%C4
ÖÐÎÄ -> utf-8µÄEncode ->
%E4%B8%AD%E6%96%87
HtmlÖеÄurlencode
£º
±àÂëΪGB2312µÄhtmlÎļþÖУº
http://www.fufuok.com
/ÖÐÎÄ.rar -> ä¯ÀÀÆ÷×Ô¶¯×ª»»Îª -> http://www.fufuok.com/%D6%D0%CE%C4.rar
×¢
Ò⣺Firefox¶ÔGB2312µÄEncodeµÄÖÐÎÄURLÖ§³Ö²»ºÃ£¬ÒòΪËüĬÈÏÊÇutf-8±àÂë·¢ËÍURLµÄ£¬µ«ÊÇftp://ÐÒé¿ÉÒÔ£¬Ó¦¸ÃËãÊÇ
FirefoxÒ»¸öbug¡£
±àÂëΪutf-8µÄhtmlÎļþÖУº
http://www.fufuok.com
/ÖÐÎÄ.rar -> ä¯ÀÀÆ÷×Ô¶¯×ª»»Îª ->
http://www.fufuok.com/%E4%B8%AD%E6%96%87.rar
PHPÖеÄurlencode
£º
<?php
//GB2312
µÄEncode
echo urlencode("ÖÐÎÄ-_. ")."\n"; //%D6%D0%CE%C4-_.+
echo
urldecode("%D6%D0%CE%C4-_. ")."\n"; //ÖÐÎÄ-_.
echo rawurlencode("ÖÐÎÄ-_.
")."\n"; //%D6%D0%CE%C4-_.%20
echo rawurldecode("%D6%D0%CE%C4-_.
")."\n"; //ÖÐÎÄ-_.
?>
³ýÁË -_.
Ö®ÍâµÄËùÓзÇ×ÖĸÊý×Ö×Ö·û¶¼½«±»Ìæ»»³É°Ù·ÖºÅ£¨%£©ºó¸úÁ½Î»Ê®Áù½øÖÆÊý¡£
urlencodeºÍrawurlencodeµÄÇø±ð
£º
urlencode
½«¿Õ¸ñÔò±àÂëΪ¼ÓºÅ£¨+£©
rawurlencode ½«¿Õ¸ñÔò±àÂëΪ¼ÓºÅ£¨%20£©
Èç¹ûҪʹÓÃutf-8µÄEncode£¬ÓÐÁ½ÖÖ
·½·¨£º
Ò»¡¢½«Îļþ´æΪutf-8Îļþ£¬Ö±½ÓʹÓÃurlencode¡¢rawurlencode¼´¿É¡£
¶þ¡¢Ê¹ÓÃ
mb_convert_encodingº¯Êý¡£
<?php
$url =
'http://www.fufuok.com/ÖÐÎÄ.rar';
echo
u
Ïà¹ØÎĵµ£º
½ñÌìÍ·ÄÔÒ»ÈÈ£¬Ïë¿´Ò»ÏÂÒ³ÃæÔÚÖ´ÐеĹý³ÌÖÐÕ¼ÓÃÁ˶àÉÙÄڴ棬ÎÒÒ²²»ÖªµÀÕâÑù×öµÄÄ¿µÄÊÇʲô£¬¿ÉÄÜÊdzöÓÚÎҵĹßÐÔ˼ά°É¡£²»¹ýÕâÑù×öÒ²²»ÊÇÍêȫûÓã¬
Äã¿ÉÒÔÇå³þµÄÖªµÀÄÄЩҳÃæÕ¼ÓõÄÄÚ´æ±È½Ï¶à£¬ÌرðÊǶÔÓÚʹÓù²ÓÃÖ÷»úµÄÍøÕ¾£¬Ò»°ã¿Õ¼äÉ̶¼»áÏÞÖÆÿ¸öÍøÕ¾µÄ×ÊÔ´Õ¼ÓÃÇé¿öµÄ£¨°üÀ¨cpuºÍÄڴ棩¡£ÍòÒ»ÔÚÎÒ
ÃDz»ÖªµÀµÄÇé¿öÏ£ ......
//ðÅÝÅÅÐò£¨Êý×éÖÐʵÏÖ£©
function bubble_sort($arr) {
$cnt = count($arr);
if($cnt<=0) return false;
for($i=0; $i<$cnt;$i++) {
for($j=$cnt-1; $j>$i;$j--) {
if($arr[$j]<$arr[$j-1]) {
$tmp = $arr[$j];
$arr[$j] = $arr[$j ......
<?php
function make_rand($length="32"){//ÑéÖ¤ÂëÎÄ×ÖÉú³Éº¯Êý
$str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
$result="";
for($i=0;$i<$length;$i++){
$num[$i]=rand(0,61);
$result.=$str[$num[$i]];
}
return $result;
} ......
×î½üÓÃwin7ÁË£¬ÅªÁ˸ö¼¤»îÂ룬Ҳ²»ÖªµÀÄÜÓõ½Ê²Ã´Ê±ºò£¬ÐÄÀï¶àÉÙÊÇÓеãÓÇÂǵģ¬Ã»¸öµ×£¬¹ÜËûµÄÄØ£¬ÏÖÔÚÄÜÓþÍÏÈÓÃ×Å£¬ÒÔǰҲûÍæÔõô¹ýVista£¬²»¹ý¸Ð¾õwin7½çÃæÉÏ»¹ÊÇÓеãÏñVistaµÄ£¬ÓÐЩ¹¦ÄÜÉÏÒ²²î²»¶à£¬²»¹ý¸Ð¾õÓÃÕâ¸öwin7»¹Õæ²»´í£¬ÎÒÒ²Ö»ÊÇÏà¶ÔXPµÄ¸Ð¾õ£¬µ±È»ÁË£¬win7µÄÓ²Å̿ռ䵹ÊÇÕ¼ÓÃÁ˲»ÀÏÉÙÎÒ19GµÄCÅÌ×°Íêºó¾Í»¹Ê£ ......