php ×Ö·û´®º¯Êý
Ò»¡¢×Ö·û´®»ù´¡º¯Êý
ltrim: È¥³ýÁ¬Ðø¿Õ°×¡£
trim: ½ØÈ¥×Ö·û´®Ê×βµÄ¿Õ¸ñ¡£
Chop: º¯Êý´Ó×Ö·û´®µÄÄ©¶Ë¿ªÊ¼É¾³ý¿Õ°××Ö·û»òÆäËûÔ¤¶¨Òå×Ö·û¡££¨rtrim±ðÃû£©
<?php
$str = "Hello World!\n\n";
echo $str;
echo chop($str);
?>
Êä³ö£º
Hello World! Hello World!
htmlspecialchars(string,quotestyle,character-set): º¯Êý°ÑһЩԤ¶¨ÒåµÄ×Ö·ûת»»Îª HTML ʵÌå¡£
Ô¤¶¨ÒåµÄ×Ö·ûÊÇ£º
& £¨ºÍºÅ£© ³ÉΪ &
" £¨Ë«ÒýºÅ£© ³ÉΪ "
' £¨µ¥ÒýºÅ£© ³ÉΪ '
< £¨Ð¡ÓÚ£© ³ÉΪ <
> £¨´óÓÚ£© ³ÉΪ >
Àý×Ó
<html>
<body>
<?php
$str = "John & 'Adams'";
echo htmlspecialchars($str, ENT_COMPAT);
echo "<br />";
echo htmlspecialchars($str, ENT_QUOTES);
echo "<br />";
echo htmlspecialchars($str, ENT_NOQUOTES);
?>
</body>
</html>ä¯ÀÀÆ÷Êä³ö£º
John & 'Adams'
John & 'Adams'
John & 'Adams'Èç¹ûÔÚä¯ÀÀÆ÷Öв鿴Դ´úÂ룬»á¿´µ½ÕâЩ HTML£º
<html>
<body>
John & 'Adams'<br />
John & 'Adams'<br />
John & 'Adams'
</body>
</html>
htmlentities(string,quotestyle,character-set): ½«ËùÓеÄ×Ö·û¶¼×ª³É HTML ×Ö·û´®¡£
Àý×Ó
<html>
<body>
<?php
$str = "John & 'Adams'";
echo htmlentities($str, ENT_COMPAT);
echo "<br />";
echo htmlentities($str, ENT_QUOTES);
echo "<br />";
echo htmlentities($str, ENT_NOQUOTES);
?>
</body>
</html>ä¯ÀÀÆ÷Êä³ö£º
John & 'Adams'
John & 'Adams'
John & 'Adams'Èç¹ûÔÚä¯ÀÀÆ÷Öв鿴Դ´úÂ룬»á¿´µ½ÕâЩ HTML£º
<html>
<body>
John & 'Adams'<br />
John & 'Adams'<br />
John & 'Adams'
</body>
</html>
nl2br: ½«»»ÐÐ×Ö·ûת³É <br>¡£
strcmp(string1,string2)º¯Êý±È½ÏÁ½¸ö×Ö·û´®¡£
¸Ãº¯Êý·µ»Ø£º
0 - Èç¹ûÁ½¸ö×Ö·û´®ÏàµÈ
<0 - Èç¹û string1 СÓÚ string2
>0 - Èç¹û string1 ´óÓÚ string2
¶þ¡¢×Ö·û´®´óСдת»»º¯Êý
strtolower: ×Ö·û´®È«×ªÎªÐ¡Ð´¡£
strtoupper
Ïà¹ØÎĵµ£º
it is 21th of May. The Month of PHP Security
(http://www.php-security.org) is still running and we have reached a
vulnerability count of 40 vulnerabilities, which is nearly as much as we
disclosed during the whole Month of PHP Bugs in 2007. However there are
11 more days until the end of May and ......
ÓÃPHP±à³Ì£¬Ê¹Óûñȡʱ¼äµÄ´úÂ룬µ«ÊÇ»ñÈ¡µ½µÄʱ¼ä×ÜÊDZȵ±Ç°Ê±¼äÔç8¸öСʱ£¬°Ù˼²»µÃÆä½â£¬ÔÚÍøÉÏËÑË÷ÁËÏ£¬ÖÕÓÚÕÒµ½Á˽â¾ö°ì·¨£¬ÔÀ´ÊÇʱÇøÉèÖÃÎÊÌâ¡£ ½â¾ö°ì·¨Ò»£º ÔÚphp.iniÀïÉèÖà date.timezone = ʱÇø ½â¾ö°ì·¨¶þ£º ²»ÓÃÐÞ¸Äphp.inÎļþ£¬Ö±½ÓÔÚ»ñȡʱ¼äµÄ´úÂëÇ°Ãæ¼ÓÉÏ£º date_default_timezone_set('ʱÇø'); ±ÈÈ ......
Æ¥ÅäÖÐÎÄ×Ö·ûµÄÕýÔò±í´ïʽ
£º [\u4e00-\u9fa5]
Æ¥ÅäË«×Ö½Ú×Ö·û(°üÀ¨ºº×ÖÔÚÄÚ)
£º ["\x00-\xff]
Ó¦Ó㺼ÆËã×Ö·û´®µÄ³¤¶È
£¨Ò»¸öË«×Ö½Ú×Ö·û³¤¶È¼Æ2£¬ASCII×Ö·û¼Æ1£©
String.prototype.len=function(){return
th ......
http://edu.codepub.com/2010/0131/20248.php
ÆäʵÕâ¸öÓ¦¸Ã²»ËãÊÇÒÉÄÑÎÊÌ⣬¾ÍÊÇphpÖÐÓà sessionidµÃµ½sessionµÄÖµ£¬ÒòΪµÄÈ·ºÜ¼òµ¥£¬Ö»ÊÇ¿ÉÄÜ´ó¼ÒƽʱÓò»µ½ËùÒÔûÓÐ×¢Òâµ½°ÕÁË¡£
ÏÈ˵˵£¬Õâ¸ö»úÖƵÄÓÃ;°É£¬µ½ÏÖÔÚΪֹսµØÖªµÀÕâ¸ö»úÖÆÓÐÁ½¸ö·½ÃæµÄÓÃ;£º
ÆäʵÕâ¸öÓ¦¸Ã²»ËãÊÇÒÉÄÑÎÊÌ⣬¾ÍÊÇphpÖÐÓà sessi ......
¡¾1¡¿Ò³ÃæÖ®¼äÎÞ·¨´«µÝ±äÁ¿ get,post,sessionÔÚ×îеÄphp°æ±¾ÖÐ×Ô¶¯È«¾Ö±äÁ¿Êǹرյģ¬ËùÒÔÒª´ÓÉÏÒ»Ò³ÃæÈ¡µÃÌá½»¹ýÀ´µÃ±äÁ¿ÒªÊ¹ÓÃ$_GET['foo'],$_POST['foo'],$_SESSION['foo']À´µÃµ½¡£µ±È»Ò²¿ÉÒÔÐÞ¸Ä×Ô¶¯È«¾Ö±äÁ¿Îª¿ª(php.ini¸ÄΪregister_globals = On)£»¿¼Âǵ½¼æÈÝÐÔ£¬»¹ÊÇÇ¿ÆÈ×Ô¼ºÊìϤеÄд·¨±È½ÏºÃ¡£
¡¡¡¡¡¾2¡¿Wi ......