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

PHP Òì³£´¦Àí


Òì³££¨Exception£©ÓÃÓÚÔÚÖ¸¶¨µÄ´íÎó·¢Éúʱ¸Ä±ä½Å±¾µÄÕý³£Á÷³Ì¡£
ʲôÊÇÒì³££¿
PHP 5 ÌṩÁËÒ»ÖÖеÄÃæÏò¶ÔÏóµÄ´íÎó´¦Àí·½·¨¡£
Òì³£´¦ÀíÓÃÓÚÔÚÖ¸¶¨µÄ´íÎó£¨Òì³££©Çé¿ö·¢Éúʱ¸Ä±ä½Å±¾µÄÕý³£Á÷³Ì¡£ÕâÖÖÇé¿ö³ÆÎªÒì³£¡£
µ±Òì³£±»´¥·¢Ê±£¬Í¨³£»á·¢Éú£º
µ±Ç°´úÂë״̬±»±£´æ
´úÂëÖ´Ðб»Çл»µ½Ô¤¶¨ÒåµÄÒì³£´¦ÀíÆ÷º¯Êý
¸ù¾ÝÇé¿ö£¬´¦ÀíÆ÷Ò²Ðí»á´Ó±£´æµÄ´úÂë×´Ì¬ÖØÐ¿ªÊ¼Ö´ÐдúÂ룬ÖÕÖ¹½Å±¾Ö´ÐУ¬»ò´Ó´úÂëÖÐÁíÍâµÄλÖüÌÐøÖ´Ðнű¾
ÎÒÃǽ«Õ¹Ê¾²»Í¬µÄ´íÎó´¦Àí·½·¨£º
Òì³£µÄ»ù±¾Ê¹ÓÃ
´´½¨×Ô¶¨ÒåµÄÒì³£´¦ÀíÆ÷
¶à¸öÒì³£
ÖØÐÂÅ׳öÒì³£
ÉèÖö¥²ãÒì³£´¦ÀíÆ÷
Òì³£µÄ»ù±¾Ê¹ÓÃ
µ±Òì³£±»Å׳öʱ£¬ÆäºóµÄ´úÂë²»»á¼ÌÐøÖ´ÐУ¬PHP »á³¢ÊÔ²éÕÒÆ¥ÅäµÄ "catch" ´úÂë¿é¡£
Èç¹ûÒ쳣ûÓб»²¶»ñ£¬¶øÇÒÓÖûÓÃʹÓà set_exception_handler() ×÷ÏàÓ¦µÄ´¦ÀíµÄ»°£¬ÄÇô½«·¢ÉúÒ»¸öÑÏÖØµÄ´íÎó£¨ÖÂÃü´íÎ󣩣¬²¢ÇÒÊä³ö "Uncaught Exception" £¨Î´²¶»ñÒì³££©µÄ´íÎóÏûÏ¢¡£
ÈÃÎÒÃdz¢ÊÔÅ׳öÒ»¸öÒì³££¬Í¬Ê±²»È¥²¶»ñËü£º
<?php //create function with an exception function checkNum($number) { if($number>1) { throw new Exception("Value must be 1 or below"); } return true; } //trigger exception checkNum(2); ?>
ÉÏÃæµÄ´úÂë»á»ñµÃÀàËÆÕâÑùµÄÒ»¸ö´íÎó£º
Fatal error: Uncaught exception 'Exception' with message 'Value must be 1 or below' in C:\webfolder\test.php:6 Stack trace: #0 C:\webfolder\test.php(12): checkNum(28) #1 {main} thrown in C:\webfolder\test.php on line 6 Try, throw ºÍ catch
Òª±ÜÃâÉÏÃæÀý×Ó³öÏֵĴíÎó£¬ÎÒÃÇÐèÒª´´½¨Êʵ±µÄ´úÂëÀ´´¦ÀíÒì³£¡£
´¦Àí´¦Àí³ÌÐòÓ¦µ±°üÀ¨£º
Try - ʹÓÃÒì³£µÄº¯ÊýÓ¦¸ÃλÓÚ "try" ´úÂë¿éÄÚ¡£Èç¹ûûÓд¥·¢Òì³££¬Ôò´úÂ뽫ÕÕ³£¼ÌÐøÖ´ÐС£µ«ÊÇÈç¹ûÒì³£±»´¥·¢£¬»áÅ׳öÒ»¸öÒì³£¡£
Throw - ÕâÀï¹æ¶¨ÈçºÎ´¥·¢Òì³£¡£Ã¿Ò»¸ö "throw" ±ØÐë¶ÔÓ¦ÖÁÉÙÒ»¸ö "catch"
Catch - "catch" ´úÂë¿é»á²¶»ñÒì³££¬²¢´´½¨Ò»¸ö°üº¬Òì³£ÐÅÏ¢µÄ¶ÔÏó
ÈÃÎÒÃÇ´¥·¢Ò»¸öÒì³££º
<?php //´´½¨¿ÉÅ׳öÒ»¸öÒì³£µÄº¯Êý function checkNum($number) { if($number>1) { throw new Exception("Value must be 1 or below"); } return true; } //ÔÚ "try" ´úÂë¿éÖд¥·¢Òì³£ try { checkNum(2); //If the exception is thrown, this text will not be shown echo 'If you see this, the number is 1 or below'; } //²¶»ñÒì³£ catch(Exceptio


Ïà¹ØÎĵµ£º

blogÔ´ÂëÕûÀí£ºphp+mysql²©¿Í³ÌÐò25ÖÖ

Blogϵͳ×÷Ϊ´ó¼Ò×î³£½Ó´¥µÄ»¥ÁªÍø¶«¶«£¬ÔÚÕ¾³¤ÈºÌåÖм¸ºõÈËÊÖÒ»²©£¬´ÓÖªÃûÃÅ»§µÄ²©¿ÍƵµÀ£¬µ½ÍøÂçÓªÏúר¼Ò²©¿Í£¬ÍøÃñ¶Ô²©¿ÍµÄ¹Ø×¢¶ÈÔÚ²»¶ÏÌá¸ß²¢É¡£Ä¿Ç°ÍøÉÏÃâ·ÑµÄblogϵͳ̫ÔÓ£¬ÔÚ´ËÕûÀíPHP°æµÄBlog½éÉÜÈçÏ£º
1¡¢wordpress:http://www.wordpress.org ¹¦ÄÜÒ²ºÜÈ«Ãæ£¬Ó¦¸ÃÊÇÖ§³ÖblogµÄÊ×Ñ¡¡£ËüÓÐ×îÇ¿µÄÄ£°æ¹¦ÄÜ£¬ÒѾ­ ......

phpÎļþÉÏ´«¼òµ¥Ê¾Àý

<?php
/*
Å׸öש£¬¾ßÌåÒª×ö³ÉʲôÑù×Ô¼º×ö¡£
*/
if(isset($_FILES['userfile']['tmp_name'])){
$userfile = $_FILES['userfile']['tmp_name']; //±£´æÔÚϵͳµÄÁÙʱλÖÃ
$userfile_name = $_FILES['userfile']['name'];//ÎļþÃû
$userfile_size = $_FILES['userfile'][ ......

phpÃæÏò¶ÔÏóµÄ»ù´¡

£±,ÀàµÄ½á¹¹ÉùÃ÷·½Ê½£º
¡¡¡¡ class ÀàÃû {
               //ÀàÌå
      }
£²£¬ÊôÐԺͷ½·¨µÄ¶¨Ò壻
¡¡¡¡Ê¹Óù¹Ô캯Êý£º
¡¡¡¡Ê¹ÓÃÎö¹¹º¯Êý£º
¡¡¡¡ÀàµÄʵÀý»¯£º
£³,¿ØÖÆ·ÃÎÊȨÏÞ£ºpublic , private protected;
£´ ......

phpÀ©Õ¹°²×°soapÄ£¿é





Ê×ÏȰ²×°Íêphp
ºó×îºÃ±£Áôµ±Ê±°²×°µÄÎļþ£¬±ÈÈçÎҵķ¾¶/export1/soft
#cd php-5.2.8/ext/soap
#/usr/local/php/bin/phpize
#./configure --with-php-config=/usr/local/php/bin/php-config
--enable-soap
#make
#make install

±àÒëºóµÄsoap.so
Îļþ± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ