AddSlashes: ×Öu´®¼ÓÈeбÏß¡£
bin2hex: ¶þ½øλת³ÉÊ®Áu½øλ¡£
Chop: È¥³ýÁ¬Ðø¿Õ°×¡£
Chr: µ»ØÐoÊýÖµµÄ×Öu¡£
chunk_split: ½«×Öu´®Ö³ÉС¶Î¡£
convert_cyr_string: ת»»¹Å˹Ào×Öu´®³ÉÆaËu×Öu´®¡£
crypt: ½«×Öu´®Óà DES ±aÂe¼ÓÃÜ¡£
echo: Êa³o×Öu´®¡£
explode: Çпª×Öu´®¡£
flush: Ça³oÊa³o»º³aÇø¡£
get_meta_tags: ³e³oÎļþËuÓÐ meta ±e¼ÇµÄ×ÊÁÏ¡£
htmlspecialchars: ½«ÌØÊa×Öuת³É HTML ¸ñʽ¡£
htmlentities: ½«ËuÓеÄ×Öu¶¼×ª³É HTML ×Öu´®¡£
implode: ½«Êý×e±a³É×Öu´®¡£
join: ½«Êý×e±a³É×Öu´®¡£
ltrim: È¥³ýÁ¬Ðø¿Õ°×¡£
md5: ¼ÆËa×Öu´®µÄ MD5 ¹þÏ¡¡£
nl2br: ½«»»ÐÐ×Öuת³É
¡£
Ord: µ»Ø×ÖuµÄÐoÊýÖµ¡£
parse_str: ½aÎo query ×Öu´®³É±aÁ¿¡£
print: Êa³o×Öu´®¡£
printf: Êa³o¸ñʽ»¯×Öu´®¡£
quoted_printable_decode: ½« qp ±aÂe×Öu´®×ª³É 8 λ×Öu´®¡£
QuoteMeta: ¼ÓÈeÒýÓÃuºÅ¡£
rawurldecode: ´Ó URL רÓøñʽ×Öu´®»¹Ô³ÉÆÕͨ×Öu´®¡£
rawurlencode: ½«×Öu´®±aÂe³É URL רÓøñʽ¡£
setlocale: ÅaÖõØÓo»¯ÐÅÏ¢¡£
similar_text: ¼ÆËa×Öu´®ÏaËƶȡ£
soundex: ¼ÆËa×Öu´®µÄ¶ÁÒoÖµ
sprintf: ½«×Öu´®¸ñʽ»¯¡£
strchr: Ñ°ÕÒµÚÒ»¸o³oÏÖµÄ×Öu¡£
strcmp: ×Öu´®±È½Ï¡£
strcspn: ²»Í¬×Öu´®µÄ³¤¶È¡£
strip_tags: È¥µo HTML ¼° PHP µÄ±e¼Ç¡£
StripSlashes: È¥µo´Ð±Ïß×Öu¡£
strlen: È¡µÃ×Öu´®³¤¶È¡£
strrpos: Ñ°ÕÒ×Öu´®ÖÐij×Öu×iºo³oÏÖ´¦¡£
strpos: Ñ°ÕÒ×Öu´®ÖÐij×Öu×iÏȳoÏÖ´¦¡£
strrchr: È¡µÃij×Öu×iºo³oÏÖ´¦ÆðµÄ×Öu´®¡£
strrev: µßµ¹×Öu´®¡£
strspn: ÕÒ³oij×Öu´®ÂaÔÚÁiÒ»×Öu´®ÕÚÕÖµÄÊýÄ¿¡£
strstr: µ»Ø×Öu´®ÖÐij×Öu´®¿ªÊ¼´¦ÖÁ½aÊøµÄ×Öu´®¡£
strtok: Çпª×Öu´®¡£
strtolower: ×Öu´®È«×ªÎªÐ¡Ð´¡£
strtoupper: ×Öu´®È«×ªÎª´oд¡£
str_replace: ×Öu´®È¡´u¡£
strtr: ת»»Ä³Ð(C)×Öu¡£
substr: È¡²¿Ý×Öu´®¡£
trim: ½ØÈ¥×Öu´®Ê×βµÄ¿Õ¸ñ¡£
ucfirst: ½«×Öu´®µÚÒ»¸o×Öu¸Ä´oд¡£
ucwords: ½«×Öu´®Ã¿¸o×ÖµÚÒ»¸o×Öĸ¸Ä´oд¡£
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýʹÐeÒªÈÃÊý¾Ý¿a´¦ÀiµÄ×Öu´®£¬ÒýºÅµÄ²¿Ý¼ÓÉÏбÏߣ¬ÒÔ¹(C)Êý¾Ý¿a²eѯ (query) ÄÜ˳ÀuÔË×÷¡£ÕaÐ(C)»a±»¸ÄµÄ×Öu°uÀ¨µ¥ÒýºÅ (')¡¢Ë«ÒýºÅ (")¡¢´Ð±Ïß backslash (\) ÒÔ¼°¿Õ×Ö*u NUL (the null byte)¡£
²Î¿¼: stripslashes() htmlspecialchars() quotemeta()
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýÈöþ½øλ×Öu´®×ª³ÉÊ®Áu½øλ×Öu´®¡£
ʹÓÃ*¶Àý
²¹³a:
josh@superfork.com (22-Jun-1999) дÁËÒ»¸oº¯Êý£¬¿É½«Ê®Áu½øλת³É¶þ½øλ¡£
<?
function hex2bin($data) {
$len = strlen($data);
for($i=0;$i<$len;$i+=2) {
$newdata .= pack("C",hexdec(substr($string,$i,2)));
}
return $newdata;
}
?>
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«×Öu´®µÄÁ¬Ðø¿Õ°×Ça³ý¡£
ʹÓöÀý
<?
$trimmed = Chop($line);
?>
²Î¿¼: trim()
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«×ÖuµÄÐoÊýת³É ASCII µÄ×Öu¡£±¾º¯ÊýºÍ ord() ³É¶ÔÕÕ¡£
ʹÓöÀý
<?
$str .= chr(27);
$str = sprintf("×Öu´®µÄ½aÊø×Ö*uÊÇ: %c", 27);
?>
²Î¿¼: ord() sprintf()
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«×Öu±a³ÉС¶Î¹(C)ÆaËuº¯ÊýʹÓá£ÀýÈ磬base64_encode¡£ÄÚ¶¨ÊDzÎÊý chunklen (76 ¸o×Öu) ÿ¸o 76 ¸o×Öu²aÈe end ("\r\n")¡£µ»ØÐÂ×Öu´®¶ø²»¸Ä¶¯Ô×Öu´®¡£
ʹÓöÀý
½«×Öu´® $data ¸ñʽ»¯³É MIME BASE64 ¸ñʽ
<?
$new_string = chunk_split(base64_encode($data));
?>
²Î¿¼: ereg_replace()
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«¹Å˹Ào×Öu´®×ª³ÉÆaËuµÄ×Öu´®¡£from ¼° to ¶þ¸o²ÎÊýÊÇ×Öu£¬Æa´u±iÒaÒaÈçÏ£º
k - koi8-r
w - windows-1251
i - iso8859-5
a - x-cp866
d - x-cp866
m - x-mac-cyrillic
Ói¨: string crypt(string str, string [salt]);
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ±aÂe´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«×Öu´®Óà UNIX µÄ±e×¼¼ÓÃÜ DES Ä£¿e¼ÓÃÜ¡£ÕaÊǵ¥ÏoµÄ¼ÓÃܺ¯Êý£¬ÎÞ¨½aÃÜ¡£Óu±È¶Ô×Öu´®£¬½«ÒѼÓÃܵÄ×Öu´®µÄͶþ¸o×ÖuÅÔÚ salt µÄ²ÎÊýÖУ¬ÔٱȶԼÓÃܺoµÄ×Öu´®¡£
¸uÏeϸµÄ×ÊÁÏÇe²Î¿¼ UNIX Manual (man) ÖÐµÄ crypt¡£
ÔÚÒ»Ð(C)½ÏÐ嵀 UNIX °ae±¾ÖУ¬³ýÁË DES Ö®Ía»¹Ìa¹(C)ÁËÆaËuµÄ¼ÓÃÜÄ£¿e£¬Èç MD5¡£ÉoÖÁÓÐÐ(C)ϵͳ»¹Óà MD5 È¡´u DES¡£ÔÚ salt ²ÎÊý»¹ÓÐÒ»Ð(C)±a»¯£¬¶Ë¿´´«¸ø salt ²ÎÊýµÄ×Öu´®³¤¶È¶ø¶¨£º
CRYPT_STD_DES - ±e×¼µÄ DES ±aÂe£¬ÊaÈe 2 ×ÖuµÄ salt¡£
CRYPT_EXT_DES - ÑÓÉiµÄ DES ±aÂe£¬ÊaÈe 9 ×ÖuµÄ salt¡£
CRYPT_MD5 - MD5 ±aÂe£¬ÊaÈe 12 ×Öu¼ÓÉÏ $1$ µÄ salt¡£
CRYPT_BLOWFISH - ÑÓÉiµÄ DES ±aÂe£¬ÊaÈe 16 ×Öu¼ÓÉÏ $2$ µÄ salt¡£
´ËÍa£¬Èo²»Ê¹Óà salt ²ÎÊý£¬Ôo³ÌÐo»a×Ô¶¯²uÉu¡£
µ»ØÖµ: ÎÞ
º¯ÊýÖÖÀa: PHP ϵͳ¹¦ÄÜ
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«×Öu´®Êa³o¡£ÓÉÓÚËu²»ÊÇÕaeÕýµÄº¯Êý£¬Òo´ËҲûÓе»ØÖµ¡£
ʹÓöÀý
<?php
echo "Hello World";
?>
²Î¿¼: print() printf() flush()
µ»ØÖµ: Êý×e
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«×Öu´®ÒÀÖ¸¶¨µÄ×Öu´®»o×Öu separator Çпª¡£½«ÇпªºoµÄ×Öu´®µ»Øµ½Êý×e±aÁ¿ÖС£
ʹÓÃ*¶Àý
<?
$pizza = "µÚһƬ µÚ¶þƬ µÚÈýƬ µÚËÄƬ µÚÎaƬ µÚÁuƬ";
$pieces = explode(" ", $pizza);
?>
²Î¿¼: implode()
*µ»ØÖµ: ÎÞ
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýÎÞÊaÈeÒaÎÞÊa³o¡£½«Êa³o»º³aÇøµÄ×ÊÁÏËͳo£¬²¢Ça³o¡£
Ói¨: array get_meta_tags(string filename, int [use_include_path]);
µ»ØÖµ: Êý×e
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½« homepage ÖеÄËuÓÐ <meta ......> ±e¼ÇµÄ×ÊÁÏÈ¡³o²¢ÅÖÃÊý×e±aÁ¿µ»Ø¡£ÀýÈç
Ói¨: string htmlspecialchars(string string);
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«ÌØÊa×Öuת³É HTML µÄ×Ö*u´®¸ñʽ ( &....; )¡£×i³£Óõ½µÄ³¡ºÏ¿ÉÄܾÍÊÇ´¦Ài¿Í»§ÁoÑÔµÄÁoÑÔ°aeÁË¡£
& (ºÍ) ת³É &
" (Ë«ÒýºÅ) ת³É "
< (СÓÚ) ת³É <
(´oÓÚ) ת³É >
²Î¿¼: htmlentities() nl2br()
´Ëº¯Êýֻת»»ÉÏÃaeµÄÌØÊa×Öu£¬²¢²»»aÈ«²¿×ª»»³É HTML Ëu¶¨µÄ ASCII ת»»¡£
ʹÓöÀý
ÕaÊÇ aulbach@unter.franken.de (27-Jan-1999) ËuÌa¹(C)µÄ*¶Àý
Ói¨: string htmlentities(string string);
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýÓеaÏñ htmlspecialchars() º¯Êý£¬µ«±¾º¯Êý»a½«ËuÓÐ string µÄ×Öu¶¼×ª³É HTML µÄÌØÊa×Ö¼¯×Öu´®¡£²»¹ýÔÚת»»ºoÔĶÁÍøÒ³Ô´´uÂeµÄ½Ãae£¬»aÓкܶaÀ§ÈÅ£¬ÓÈÆaÊÇÍøÒ³Ô´´uÂeµÄÖÐÎÄ×Ö»a±aµÃ²»ÖªËuÔÆ£¬a¯ÀÀÆ÷ÉÏ¿´µ½µÄ»¹ÊÇÕý³£µÄ¡£
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«Êý×eµÄÄÚÈÝ×eºÏ³ÉÒ»¸o×Öu´®£¬²ÎÊý glue ÊÇ×ÖÖ®¼aµÄÖ¸ouºÅ¡£
ʹÓöÀý
<?
$colon_separated = implode(":", $array);
echo $colon_separated;
?>
²Î¿¼: explode() join() split()
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýÊÇ implode º¯ÊýµÄ±ðÃu¡£
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýÓÃÀ´É¾È¥×Ö*u´®ÖеÄÁ¬Ðø¿Õ°×´ø (whitespace)¡£
Ói¨: string md5(string str);
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ±aÂe´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýÓÃÀ´¼ÆËa MD5 ¹þÏ¡¡£¹ØÓÚ MD5 ±aÂe¨£¬¿ÉÒԲο¼ RSA Data Security, Inc. MD5 Message-Digest Algorithm. RFC1321£»»oÊÇÀµÏªËÉ¡¢º«ÁÁ¡¢ÕÅÕae³ÏµÈºÏ×ÅÖ®½u´uÃÜÂeѧ¼°ÆaÓ¦Óã¬11.3¡£
Ói¨: string nl2br(string string);
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«»»ÐÐ×Öuת»»³É HTML »»ÐеÄ
Ö¸Ái¡£
²Î¿¼: htmlspecialchars() htmlentities()
µ»ØÖµ: ÕuÊý
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êýµ»Ø×ÖuµÄ ASCII (ÃÀ¹u¹u¼Ò±e×¼½»»»Âe) ÐoÊýÖµ¡£±¾º¯ÊýºÍ chr() º¯ÊýÏa´¡£
ʹÓöÀý
<?php
if (ord($str) == 10) {
echo("×Öu´® \$str µÄµÚÒ»¸o×ÖÊÇ»»ÐÐ×Ö*u¡£\n");
}
?>
²Î¿¼: chr()
Ói¨: void parse_str(string str);
µ»ØÖµ: ÎÞ
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý¿É½«a¯ÀÀÆ÷µ»ØµÄ GET ½¨µÄ QUERY_STRING ×Öu´®½aÎo¡£µ»ØµÄ±aÁ¿Ãu¼°Öµ¾ÍÒÀ QUERY_STRING µÄÃu³Æ¼°Öµ¡£
ʹÓöÀý
<?php
$str = "first=value&second;[]=this+works&second;[]=another";
parse_str($str);
echo $first; // ÏÔʾ³o "value" ×Öu´®
echo $second[0]; // ÏÔʾ "this works" ×Öu´®
echo $second[1]; // ÏÔʾ "another" ×Ö*u´®
?>
µ»ØÖµ: ²¼¶uÖµ
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýÊa³o×Öu´®¡£Èo³É¹¦Ôoµ»Ø 1£¬Ê§°ÜÔoµ»Ø 0¡£ÀýÈç´«ÊaÖÐ;¿Í»§µÄa¯ÀÀÆ÷ͻȻ¹ÒÁË£¬Ôo»aÔi³ÉÊa³oʧ°ÜµÄÇeÐΡ£
²Î¿¼: echo() printf() flush()
µ»ØÖµ: ÕuÊý
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýÒÀ²ÎÊý format Ö¸¶¨µÄÄÚÈݸñʽ½«×Öu´®¸ñʽ»¯¡£¸ñʽµÄϸ½Ú¿ÉÒԲο¼ sprintf()¡£
²Î¿¼: print() sprintf() flush()
Ói¨: string quoted_printable_decode(string str);
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ±aÂe´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý¿ÉÒÔ½« quoted-printable ºoµÄ×Öu´®½aÂe³ÉΪ 8 λ±aÂeµÄ×Öu´®¡£¶ø±¾º¯ÊýÀaËÆ imap_qprint() º¯Êý£¬Ö»Ò»²»Í¬µÄµØ½ÊÇʹÓà imap_qprint() º¯ÊýÐeÒªÈÃϵͳ¼ÓÈe IMAP µÄÄ£¿e£¬¶ø±¾º¯Êý²»ÐeÒª IMAP Ä£¿e¡£
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ×ÊÁÏ´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«×Öu´®Öк¬ÓÐ . \\ + ? [ ^ ] ( $ ) µÈ×ÖuµÄÇ°Ãae¼ÓÈe´Ð±Ïß "\" *uºÅ¡£
²Î¿¼: addslashes() htmlentities() htmlspecialchars() nl2br() stripslashes()
Ói¨: string rawurldecode(string str);
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ±aÂe´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«×Öu´®½aÂe¡£´Ó URL µÄ×Öu´®×¨Óøñʽ½a³ÉÆÕͨ×Öu´®¡£ÏeϸµÄ±aÂe½aÂeÐÅÏ¢¼°¹ae¸ñÎļþ¿ÉÒԲο¼ RFC 1738¡£
²Î¿¼: rawurlencode()
Ói¨: string rawurldecode(string str);
µ»ØÖµ: ×Öu´®
º¯ÊýÖÖÀa: ±aÂe´¦Ài
ÄÚÈÝ˵Ã÷: ±¾º¯Êý½«×Öu´®±aÂe³É URL µÄ×Öu´®×¨Óøñʽ£¬ÌØÊaµÄ×Öu»aת»»³É°ÙÖ±ÈuºÅºoÃae¼ÓÉ϶þ¸oÊ®ÁuλÊý×ֵĸñʽ¡£ÀýÈ磬¿Õ¸ñ¾Í»a±a³É %20¡£
ʹÓÃ*¶Àý
<?php
echo '';
?>
²Î¿¼: rawurldecode()
µ±Ç°1/2Ò³ 12ÏÂÒ»Ò³ÔĶÁÈ«ÎÄ