PHP³õѧÕßÍ·Í´µÄÊ®ËĸöÎÊÌâ
1.Ò³ÃæÖ®¼äÎÞ·¨´«µÝ±äÁ¿
get,post,sessionÔÚ×îеÄphp°æ±¾ÖÐ×Ô¶¯È«¾Ö±äÁ¿Êǹرյģ¬ËùÒÔÒª´ÓÉÏÒ»Ò³ÃæÈ¡µÃÌá½»¹ýÀ´µÃ±äÁ¿ÒªÊ¹ÓÃ$_GET['foo'],$_POST['foo'],$_SESSION['foo']À´µÃµ½¡£µ±È»Ò²¿ÉÒÔÐÞ¸Ä×Ô¶¯È«¾Ö±äÁ¿Îª¿ª(php.ini¸ÄΪregister_globals = On)£»¿¼Âǵ½¼æÈÝÐÔ£¬»¹ÊÇÇ¿ÆÈ×Ô¼ºÊìϤеÄд·¨±È½ÏºÃ¡£
2.Win32ÏÂapache2 ÓÃget·½·¨´«µÝÖÐÎIJÎÊý»á³ö´í
ÀýÈ磺test.php?a=ÄãºÃ&b=ÄãÒ²ºÃ
´«µÝ²ÎÊýÊǻᵼÖÂÒ»¸öÄÚ²¿´íÎó
½â¾ö°ì·¨:"test.php?a=".urlencode(ÄãºÃ)."&b=".urlencode(ÄãÒ²ºÃ)
urlencode($myname)Ö÷ÒªÓÃÓÚÕýȷʶ±ðºº×Ö ¿Õ¸ñÒÔ¼°ÆäËûÌØÊâ×Ö·û¡£
3.win32ϵÄsession²»ÄÜÕý³£¹¤×÷
php.iniĬÈϵÄsession.save_path = /tmp ÕâÏÔÈ»ÊÇlinuxϵÄÅäÖã¬win32ÏÂphpÎÞ·¨¶ÁдsessionÎļþµ¼ÖÂsessionÎÞ·¨Ê¹Ó㬰ÑËü¸Ä³ÉÒ»¸ö¾ø¶Ô·¾¶¾Í¿ÉÒÔÁË£¬ÀýÈçsession.save_path = c:windows emp ,Ò»°ãÕâ¸ö¹¤×÷ÔÚÅäÖÃphpÔÚwinµÄ°²×°»·¾³µÄʱºò¾ÍÓ¦¸Ã½â¾öµÄ¡£
4.ÏÔʾ´íÎóÐÅÏ¢
µ±php.iniµÄdisplay_errors = On²¢ÇÒerror_reporting = E_ALLʱ£¬½«ÏÔʾËùÓеĴíÎóºÍÌáʾ£¬µ÷ÊÔµÄʱºò×îºÃ´ò¿ªÒÔ±ã¾À´í¡£
5.¸ü¸Äphp.iniºóûÓб仯
Ò»°ãÒªÖØÆôÄãµÄWEB SERVER(apache IIS)¡£
6.header already sent
Õâ¸ö´íÎóͨ³£»áÔÚÄãʹÓÃHEADERµÄʱºò³öÏÖ£¬Ëû¿ÉÄÜÊǼ¸ÖÖÔÒò£º
1,ÄãÔÚʹÓÃHEADERÇ°print»òÕßechoÁË
2.Ä㵱ǰÎļþÇ°ÃæÓпÕÐÐ
3.Äã¿ÉÄÜINCLUDEÁËÒ»¸öÎļþ,
4.¸ÃÎļþβ²¿ÓпÕÐлò ÕßÊä³öÒ²»á³öÏÖÕâÖÖ´íÎó¡£
7.includeºÍrequireµÄÇø±ð
1.include °üº¬Îļþ£¬Èç¹û¸ÃÎļþ²»´æÔÚ£¬Ëü»áÌáʾ,µ«ÊÇËü»á¼ÌÐøÍùÏÂÖ´ÐС£
2.require °üº¬Îļþ£¬Èç¹û¸ÄÎļþ²»´æÔÚ£¬»áÌáʾÖÂÃü´íÎ󣬲¢Í˳ö.
win32ƽ̨ÏÂËüÃǶ¼ÊÇÏÈ°üº¬ºóÖ´ÐС£
8.isset()ºÍempty()µÄÇø±ð
Ïàͬ£ºÁ½Õ߶¼ÊDzâÊÔ±äÁ¿ÓõÄ.
²»Í¬£ºisset()ÊDzâÊÔ±äÁ¿ÊÇ·ñ±»¸³Öµ
empty()ÊDzâÊÔÒ»¸öÒѾ±»¸³ÖµµÄ±äÁ¿ÊÇ·ñΪ¿Õ
Èç¹ûÒ»¸ö±äÁ¿Ã»±»¸³Öµ¾ÍÒýÓÃÔÚphpÀïÊDZ»ÔÊÐíµÄ,µ«»áÓÐnoticeÌáʾ£¬Èç¹ûÒ»¸ö±äÁ¿±»¸³¿ÕÖµ£¬$foo=""»òÕß$foo=0»òÕß $foo=false,ÄÇôempty($foo)·µ»ØÕ棬isset($foo)Ò²
Ïà¹ØÎĵµ£º
(1) ´ò¿ªphpµÄ°²È«Ä£Ê½
phpµÄ°²È«Ä£Ê½ÊǸö·Ç³£ÖØÒªµÄÄÚǶµÄ°²È«»úÖÆ£¬Äܹ»¿ØÖÆһЩphpÖеĺ¯Êý£¬±ÈÈçsystem()£¬
ͬʱ°ÑºÜ¶àÎļþ²Ù×÷º¯Êý½øÐÐÁËȨÏÞ¿ØÖÆ£¬Ò²²»ÔÊÐí¶ÔijЩ¹Ø¼üÎļþµÄÎļþ£¬±ÈÈç/etc/passwd£¬
µ«ÊÇĬÈϵÄphp.iniÊÇûÓдò¿ª°²È«Ä£Ê½µÄ£¬ÎÒÃÇ°ÑËü´ò¿ª£º
safe_mode = on
(2) Óû§×鰲ȫ
µ±safe_mode´ò¿ªÊ±£¬ ......
È·±£ÄãµÄ´úÂëÕý³£¹¤×÷ÊDzâÊÔµÄÊ×ÒªµÄÄ¿µÄ£¬µ«ÊÇÔÚ²âÊÔÄãµÄ´úÂëʱºò£¬ÄãÓ¦¸ÃÈÏʶµ½³ý´Ë
Ö®Í⻹ÓÐһЩ¶îÍâµÄ£¬Ïà¶Ô´ÎÒªµÄÄ¿µÄ£º
1¡¢²âÊÔÈÃÄãÊéдÈÝÒײâÊԵĴúÂë¡£ÕâʹµÃ´úÂëËÉÉ¢ñîºÏ£¬¸´ÔÓÉè¼Æ£¬¶øÇÒ¾ßÓÐ
ºÜºÃµÄÄ£¿éÐÔ¡£
2¡¢²âÊÔÄÜÈÃÄãÇåÎúµÄÁ˽âÔËÐдúÂëµÄÆÚÍû½á¹û£¬ÈÃÄã´ÓÒ»¿ªÊ¼¾Í×¢ÖØÓÚÄ£¿éµÄ
Éè¼ÆºÍ·ÖÎö¡£Í¨¹ý²âÊÔ£¬ ......
PHP
ÊÇÎÒÓùýµÄÓïÑÔÖУ¬×îÁîÈËÄÕ»ðµÄµ«Í¬Ê±Ò²ÊÇ×îÓÐȤµÄÓïÑÔ¡£ÎÒÖ®ËùÒÔ˵“ÁîÈËÄÕ»ð”Ö÷ÒªÊÇÒòΪº¯ÊýÃüÃû¼«Æä²»Ò»Ö¡£¾¡¹ÜÎÒÿÌ춼ҪÓõ½ÕâЩº¯Êý£¬ÎÒ»¹ÊÇÒªÏë
һϓ¾¿¾¹ÊÇ str_pos »¹ÊÇ strpos£¿ÊÇ str_split »¹ÊÇ
strsplit£¿”¡£ÁíÒ»·½Ã棬ÓÐʱºò¿ÉÒÔÓÃÒ»Ðмòµ¥µÄ´úÂë¾ÍÄܽâ¾öÒ»¸öÄÑÌâ¡£
ÏÂÃæ ......
Floating point precision
It is typical that simple decimal fractions like 0.1
or
0.7
cannot be converted into their internal binary
counterparts without a small loss of precision. This can lead to
confusing
results: for example, floor((0.1+0.7)*10)
will usually
return 7
......
1
£®
Çë¶Ô
POSIX
·ç¸ñºÍ¼æÈÝ
Perl
·ç¸ñÁ½ÖÖÕýÔò
±í´ïʽµÄÖ÷Òªº¯Êý½øÐÐÀà±È˵Ã÷
ereg
preg_match
ereg_replace
preg_replace
2
£®
Çë˵Ã÷ÔÚ
php
.ini
ÖÐ
safe_mode
¿ªÆôÖ®ºó¶ÔÓÚ
PHP
ϵͳ
º¯ÊýµÄÓ°Ïì
3
£®
PHP5
ÖÐħÊõ
·½·¨
º¯ÊýÓÐÄļ¸¸ö£¬Çë¾ÙÀý˵à ......