Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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 ʵÌå¡£
Ô¤¶¨ÒåµÄ×Ö·ûÊÇ£º
& £¨ºÍºÅ£© ³ÉΪ &amp;
" £¨Ë«ÒýºÅ£© ³ÉΪ &quot;
' £¨µ¥ÒýºÅ£© ³ÉΪ &#039;
< £¨Ð¡ÓÚ£© ³ÉΪ &lt;
> £¨´óÓÚ£© ³ÉΪ &gt;
Àý×Ó
<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 &amp; 'Adams'<br />
John &amp; &#039;Adams&#039;<br />
John &amp; '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 &amp; 'Adams'<br />
John &amp; &#039;Adams&#039;<br />
John &amp; 'Adams'
</body>
</html>
nl2br: ½«»»ÐÐ×Ö·ûת³É <br>¡£
strcmp(string1,string2)º¯Êý±È½ÏÁ½¸ö×Ö·û´®¡£
¸Ãº¯Êý·µ»Ø£º
0 - Èç¹ûÁ½¸ö×Ö·û´®ÏàµÈ
<0 - Èç¹û string1 СÓÚ string2
>0 - Èç¹û string1 ´óÓÚ string2 
¶þ¡¢×Ö·û´®´óСдת»»º¯Êý
strtolower: ×Ö·û´®È«×ªÎªÐ¡Ð´¡£
strtoupper


Ïà¹ØÎĵµ£º

Month of PHP Security Summary

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 »ñȡʱ¼ä²»×¼È· ²î8Сʱ µÄ ½â¾ö·½·¨

ÓÃPHP±à³Ì£¬Ê¹Óûñȡʱ¼äµÄ´úÂ룬µ«ÊÇ»ñÈ¡µ½µÄʱ¼ä×ÜÊDZȵ±Ç°Ê±¼äÔç8¸öСʱ£¬°Ù˼²»µÃÆä½â£¬ÔÚÍøÉÏËÑË÷ÁËÏ£¬ÖÕÓÚÕÒµ½Á˽â¾ö°ì·¨£¬Ô­À´ÊÇʱÇøÉèÖÃÎÊÌâ¡£ ½â¾ö°ì·¨Ò»£º ÔÚphp.iniÀïÉèÖà date.timezone = ʱÇø ½â¾ö°ì·¨¶þ£º ²»ÓÃÐÞ¸Äphp.inÎļþ£¬Ö±½ÓÔÚ»ñȡʱ¼äµÄ´úÂëÇ°Ãæ¼ÓÉÏ£º date_default_timezone_set('ʱÇø'); ±ÈÈ ......

PHP³£ÓÃÕýÔò±í´ïʽ

    Æ¥ÅäÖÐÎÄ×Ö·ûµÄÕýÔò±í´ïʽ
£º [\u4e00-\u9fa5]
    Æ¥ÅäË«×Ö½Ú×Ö·û(°üÀ¨ºº×ÖÔÚÄÚ)
£º ["\x00-\xff]
    Ó¦Ó㺼ÆËã×Ö·û´®µÄ³¤¶È
£¨Ò»¸öË«×Ö½Ú×Ö·û³¤¶È¼Æ2£¬ASCII×Ö·û¼Æ1£©
    String.prototype.len=function(){return
th ......

PHPͨ¹ýsession id ʵÏÖsession¹²ÏíºÍµÇ¼ÑéÖ¤[ת]

http://edu.codepub.com/2010/0131/20248.php
ÆäʵÕâ¸öÓ¦¸Ã²»ËãÊÇÒÉÄÑÎÊÌ⣬¾ÍÊÇphpÖÐÓàsessionidµÃµ½sessionµÄÖµ£¬ÒòΪµÄÈ·ºÜ¼òµ¥£¬Ö»ÊÇ¿ÉÄÜ´ó¼ÒƽʱÓò»µ½ËùÒÔûÓÐ×¢Òâµ½°ÕÁË¡£
 
ÏÈ˵˵£¬Õâ¸ö»úÖƵÄÓÃ;°É£¬µ½ÏÖÔÚΪֹսµØÖªµÀÕâ¸ö»úÖÆÓÐÁ½¸ö·½ÃæµÄÓÃ;£º
ÆäʵÕâ¸öÓ¦¸Ã²»ËãÊÇÒÉÄÑÎÊÌ⣬¾ÍÊÇphpÖÐÓà sessi ......

×îÁîPHP³õѧÕßÍ·Í´µÄÊ®ËĸöÎÊÌâ


¡¾1¡¿Ò³ÃæÖ®¼äÎÞ·¨´«µÝ±äÁ¿ get,post,sessionÔÚ×îеÄphp°æ±¾ÖÐ×Ô¶¯È«¾Ö±äÁ¿Êǹرյģ¬ËùÒÔÒª´ÓÉÏÒ»Ò³ÃæÈ¡µÃÌá½»¹ýÀ´µÃ±äÁ¿ÒªÊ¹ÓÃ$_GET['foo'],$_POST['foo'],$_SESSION['foo']À´µÃµ½¡£µ±È»Ò²¿ÉÒÔÐÞ¸Ä×Ô¶¯È«¾Ö±äÁ¿Îª¿ª(php.ini¸ÄΪregister_globals = On)£»¿¼Âǵ½¼æÈÝÐÔ£¬»¹ÊÇÇ¿ÆÈ×Ô¼ºÊìϤеÄд·¨±È½ÏºÃ¡£
¡¡¡¡¡¾2¡¿Wi ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ