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)Ò²
Ïà¹ØÎĵµ£º
È·±£ÄãµÄ´úÂëÕý³£¹¤×÷ÊDzâÊÔµÄÊ×ÒªµÄÄ¿µÄ£¬µ«ÊÇÔÚ²âÊÔÄãµÄ´úÂëʱºò£¬ÄãÓ¦¸ÃÈÏʶµ½³ý´Ë
Ö®Í⻹ÓÐһЩ¶îÍâµÄ£¬Ïà¶Ô´ÎÒªµÄÄ¿µÄ£º
1¡¢²âÊÔÈÃÄãÊéдÈÝÒײâÊԵĴúÂë¡£ÕâʹµÃ´úÂëËÉÉ¢ñîºÏ£¬¸´ÔÓÉè¼Æ£¬¶øÇÒ¾ßÓÐ
ºÜºÃµÄÄ£¿éÐÔ¡£
2¡¢²âÊÔÄÜÈÃÄãÇåÎúµÄÁ˽âÔËÐдúÂëµÄÆÚÍû½á¹û£¬ÈÃÄã´ÓÒ»¿ªÊ¼¾Í×¢ÖØÓÚÄ£¿éµÄ
Éè¼ÆºÍ·ÖÎö¡£Í¨¹ý²âÊÔ£¬ ......
phpÖж¨½ç·û<<<µÄ×÷Óà - [phpÓï
ÑÔ
]
[Time:2009-08-18]
°æȨÉùÃ÷
£º×ªÔØʱÇëÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂÔʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
ת×Ô:http://star210.blogbus.com/logs/44486135.html
ÒòΪPHPÊÇÒ»¸öWeb±à³ÌÓïÑÔ£¬ÔÚ±à³Ì¹ý³ÌÖÐÄÑÃâ»áÓöµ½ÓÃechoÀ´Êä³ö´ó¶ÎµÄhtmlºÍjavascript
½Å
±¾µÄÇé¿ö£¬Èç¹ûÓô«Í³µÄÊ ......
PHPÔÚÔËÐеÄʱºò£¬Ö±½Ókillµô£¬ÓпÏÄÜÔì³ÉÊý¾ÝµÄ¶ªÊ§¡£ÐÒºÃphpÄ£¿é£¬ÓÐÕë¶ÔsignalµÄ´¦Àí¡£
´¦Àí·½Ê½£¬Ê×Ïȼì²éÓÐûÓа²×° PCNTL Ä£¿é
È»ºó¿ÉÒÔÔÚÒ»¸ö°üº¬ÎļþÖУ¬Ìí¼ÓÒÔÏ´úÂë
global $exitFlag;
$exitFlag = false;
// Ôö¼ÓlinuxÐźÅÁ¿´¦Àí
if (DIRECTORY_SEPARATOR != '\\') {
pcntl_signal(SI ......
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
......
$_GET ±äÁ¿ÓÃÓÚÊÕ¼¯À´×Ô method="get" µÄ±íµ¥ÖеÄÖµ¡£
$_GET ±äÁ¿
$_GET ±äÁ¿ÊÇÒ»¸öÊý×飬ÄÚÈÝÊÇÓÉ HTTP GET ·½·¨·¢Ë͵ıäÁ¿Ãû³ÆºÍÖµ¡£
$_GET ±äÁ¿ÓÃÓÚÊÕ¼¯À´×Ô method="get" µÄ±íµ¥ÖеÄÖµ¡£´Ó´øÓÐ GET ·½·¨µÄ±íµ¥·¢Ë͵ÄÐÅÏ¢£¬¶ÔÈκÎÈ˶¼ÊǿɼûµÄ£¨»áÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸£©£¬²¢ÇÒ¶Ô·¢Ë͵ÄÐÅÏ¢Á¿Ò²ÓÐÏÞÖÆ£¨×î¶à 100 ¸ö ......