40¸ö¼¼ÇÉÓÅ»¯ÄúµÄPHP´úÂë
1. Èç¹ûÒ»¸ö·½·¨Äܱ»¾²Ì¬£¬ÄǾÍÉùÃ÷ËûΪ¾²Ì¬µÄ£¬ËٶȿÉÌá¸ß1/4;
2. echoµÄЧÂʸßÓÚprint,ÒòΪechoûÓзµ»ØÖµ£¬print·µ»ØÒ»¸öÕûÐÍ;
3. ÔÚÑ»·Ö®Ç°ÉèÖÃÑ»·µÄ×î´ó´ÎÊý£¬¶ø·ÇÔÚÔÚÑ»·ÖÐ;
4. Ïú»Ù±äÁ¿È¥ÊÍ·ÅÄڴ棬ÌرðÊÇ´óµÄÊý×é;
5. ±ÜÃâʹÓÃÏñ__get, __set, __autoloadµÈħÊõ·½·¨;
6. requiere_once()±È½ÏºÄ×ÊÔ´;
7. ÔÚincludesºÍrequiresÖÐʹÓþø¶Ô·¾¶£¬ÕâÑùÔÚ·ÖÎö·¾¶»¨µÄʱ¼ä¸üÉÙ;
8. Èç¹ûÄãÐèÒªµÃsexinsexµ½½Å±¾Ö´ÐÐʱµÄʱ¼ä£¬$_SERVER['REQUSET_TIME']ÓÅÓÚtime();
9. ÄÜʹÓÃ×Ö·û´¦Àíº¯ÊýµÄ£¬¾¡Á¿ÓÃËûÃÇ£¬ÒòΪЧÂʸßÓÚÕýÔò;
10. str_replace×Ö·ûÌæ»»±ÈÕýÔòÌæ»»preg_replace¿ì£¬µ«strtr±Èstr_replaceÓÖ¿ì1/4;
11. Èç¹ûÒ»¸öº¯Êý¼ÈÄܽÓÊÜÊý×éÓÖÄܽÓÊܼòµ¥×Ö·û×öΪ²ÎÊý£¬ÀýÈç×Ö·ûÌæ»»£¬²¢ÇÒ²ÎÊýÁÐ±í²»ÊÇÌ«³¤£¬¿ÉÒÔ¿¼ÂǶàÓÃһЩ¼ò½àµÄ
Ìæ»»Óï¾ä£¬Ò»´ÎÖ»Ìæ»»Ò»¸ö×Ö·û£¬¶ø²»ÊǽÓÊÜÊý×é×öΪ²éÕÒºÍÌæ»»²ÎÊý¡£´óÊ»¯Ð¡£¬1+1>2;
12. ÓÃ@ÑڸǴíÎó»á½µµÍ½Å±¾ÔËÐÐËÙ¶È;
13. $row['id']±È$row[id]Ëٶȿì7±¶£¬½¨ÒéÑø³ÉÊý×é¼ü¼ÓÒýºÅµÄÏ°¹ß;
14. ´íÎóÐÅÏ¢ºÜÓÐÓÃ;
15. ÔÚÑ»·Àï±ðÓú¯Êý£¬ÀýÈçFor($x=0; $x < count($array); $x), count()º¯ÊýÔÚÍâÃæÏȼÆËã;
16. ÔÚ·½·¨ÀィÁ¢¾Ö²¿±äÁ¿ËÙ¶È×î¿ì£¬97xxoo¼¸ºõºÍÔÚ·½·¨Àïµ÷Óþֲ¿±äÁ¿Ò»Ñù¿ì;
17. ½¨Á¢Ò»¸öÈ«¾Ö±äÁ¿Òª±È¾Ö²¿±äÁ¿ÒªÂý2±¶;
18. ½¨Á¢Ò»¸ö¶ÔÏóÊôÐÔ(ÀàÀïÃæµÄ±äÁ¿)ÀýÈç($this->prop++)±È¾Ö²¿±äÁ¿ÒªÂý3±¶;
19. ½¨Á¢Ò»¸öδÉùÃ÷µÄ¾Ö²¿±äÁ¿Òª±ÈÒ»¸ö³õʼ»¯µÄ¾Ö²¿±äÁ¿Âý9-10±¶;
20. ÉùÃ÷Ò»¸öδ±»ÈκÎÒ»¸öº¯ÊýʹÓùýµÄÈ«¾Ö±äÁ¿Ò²»áʹÐÔÄܽµµÍ(ºÍÉùÃ÷ÏàͬÊýÁ¿µÄ¾Ö²¿±äÁ¿Ò»Ñù)£¬PHP¿ÉÄÜÈ¥¼ì²éÕâ¸öÈ«¾Ö±ä
Á¿ÊÇ·ñ´æÔÚ;
21. ·½·¨µÄÐÔÄܺÍÔÚÒ»¸öÀàÀïÃ涨ÒåµÄ·½·¨µÄÊýĿûÓйØϵ£¬ÒòΪÎÒÌí¼Ó10¸ö»ò¶à¸ö·½·¨µ½²âÊÔµÄÀàÀïÃæ
(ÕâЩ·½·¨ÔÚ²âÊÔ·½·¨µÄÇ°ºó)ºóÐÔÄÜûʲô²îÒì;
22. ÔÚ×ÓÀàÀï·½·¨µÄÐÔÄÜÓÅÓÚÔÚ»ùÀàÖÐ;
23. Ö»µ÷ÓÃÒ»¸ö²ÎÊý²¢ÇÒº¯ÊýÌåΪ¿ÕµÄº¯ÊýÔËÐл¨·ÑµÄʱ¼äµÈÓÚ7-8´Î$localvar++ÔËË㣬¶øÒ»¸öÀàËƵķ½·¨(ÀàÀïµÄº¯Êý)ÔËÐеÈÓÚ
´óÔ¼15´Î$localvar++ÔËËã;
24. ÓÃ''¶ø²»ÊÇ""½«stringÀ¨ÆðÀ´»áÔÚÒ»¶¨³Ì¶ÈÉÏÌá¸ßËٶȣ¬ÒòΪPHP»áÔÚ""¶ø²»ÊÇ''°ü¹üµÄstringÖÐËÑË÷±äÁ¿¡£
25. µ±Êä³ö×Ö·û´®Ê±ÓöººÅ´úÌæµã·Ö¸î¸ü¿ìЩ¡£×¢Ò⣺ÕâÖ»¶ÔechoÆð×÷Óã¬Õâ¸öº¯ÊýÄܽÓÊÜһЩ×Ö·û´®×÷Ϊ²ÎÊý;
26. ÔÚapache·þÎñÆ÷ÀïÒ»¸öphp½Å±¾Ò³Ãæ±ÈÏàÓ¦µÄHTML¾²Ì¬Ò³ÃæÉú³ÉÖÁÉÙÒª¶à»¨2-10±¶µÄʱ¼ä£¬½¨Òé¶àÓÃЩ¾²Ì¬HTMLÒ³Ã
Ïà¹ØÎĵµ£º
PHPÖеÄstristr()£¬strstr()£¬strpos()ËٶȱȽÏ
²âËÙ´úÂë:
<?php
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
......
½ñÌ칤×÷ÖÐÓöµ½ÁËPOSTÊý¾ÝµÄÎÊÌ⣬ÐèÒªÏòÒ»¸öÌض¨µÄURL·¢ËÍPOSTÊý¾Ý¡£
ÏÖ½«PHP·¢ËÍPOSTÊý¾ÝµÄ·½Ê½×ܽáÏ£¬·½±ã×Ô¼ºÔ츣ºóÈË£º
·½·¨Ò»£ºHTTPº¯Êý·¢ËÍ·½Ê½
˵Ã÷£º$dataΪPOST·¢Ë͵ÄÊý¾Ý£º$keyΪ²ÎÊýÃû£¬$valΪ²ÎÊýÖµ
$URL = "http://pre.payment.sdoa.sdo.com/";
$data = $key1."=".val1."&".$key2."=".val2;
$Post ......
header() is used to send raw HTTP headers. See the HTTP/1.1 specification for more information on HTTP headers.
ʹÓ÷¶Àý
·¶ÀýÒ»:
<?PHP
Header("Location: http://www.phpchina.com";);
exit;//ÔÚÿ¸öÖض¨ÏòÖ®ºó¶¼±ØÐë¼ÓÉÏ“exit",±ÜÃâ·¢Éú´íÎóºó£¬¼ÌÐøÖ´ÐС£
?>
<?php
head ......
//½«ÍøÖ·µÄ²ÎÊýתΪ±äÁ¿,Èç:xxx.php?a=1&b=2,
//ÔËÐз½·¨ºó,echo $a."|".$b, ½á¹û:1|2
extract($_GET);
//unicodeתutf8£¬Èç:中»ò \u9865 ת ³É ÖÐÎÄ
function unescape($str) {
$str = rawurldecode($str);
preg_match_all("/(?:%u.{4})|&#x.{4};|&am ......
¡¡¡¡×î½üÔÚ×ö¸öÒ³Ãæʱ£¬Óöµ½ÒªPHP³ÌÐòÖÐʵÏÖÑÓ³Ùµ±Ç°½ø³ÌÎÊÌâ¡£ÓÉÓÚ½Ó´¥PHPʱ¼äÓÐÏÞ£¬Ï뵱ȻµÄÈÏΪPHPÖÐʵÏִ˹¦Äܵĺ¯ÊýÒ²ÊÇsleep()¡£ÊÂʵÉÏ£¬ÔÚPHPÖеÄÈ·ÓÐÕâ¸öº¯Êý£¬µ«ÔÚÎÒ³¢ÊÔÁË°ëÌìºó£¬È´Ê¼ÖÕ²»ÄÜʵÏÖÎÒÒªµÄÂß¼¡£PHP5ÊÖ²áÖУ¬¶ÔÕâ¸öº¯ÊýÊÇÕâÑùÃèÊöµÄ£ºsleep -- Delay execution¡£µ±ÎÒ°Ù¶ÈÁËÒԺ󣬲ÅÖªµÀÕ⸠......