PHP½âÒÉ(תÔØ)
PHP½âÒÉ
1. ´úÂëÖØÓ÷½·¨include()ºÍrequire()º¯Êý²îÒ죿
1) Require()º¯Êý
ʹÓÃrequier()°üº¬ÍⲿphpÎļþʱ£¬Ö»Òª×ÔÉíphpÎļþ±»Ö´ÐУ¬ÍⲿÎļþµÄÄÚÈݾͽ«±»°üº¬½ø¸Ã×ÔÉíphpÎļþ£¬µ±°üº¬µÄÍⲿÎļþ·¢Éú´íÎóʱ£¬ÏµÍ³½«¸ø³ö´íÎóÌáʾ£¬²¢ÇÒÍ£Ö¹phpÎļþµÄÖ´ÐС£
ʾÀý£º
µ÷ÓÃÎļþconfig.incµÄ³ÌÐò´úÂ룺
<?php echo "Õâ¾ÍÊDZ»µ÷ÓõÄÄÚÈÝ: ÄúºÃ ! " ; ?>
µ±Ç°½Å±¾example01.phpµÄ³ÌÐò´úÂ룺
<?php
echo "´úÂëÖØÓõÄʾÀý: " ;
require ( ' config.inc ' ) ; //µ÷ÓÃÁíÍâÒ»¸öÎļþconfig.inc,Êä³öconfig.incÖеÄÄÚÈÝ
echo "ʹÓÃrequireº¯ÊýʵÏÖµÄ." ; ?>ʵÀýλÖãºmr\sl\04\example01.php
½á¹ûΪ£º´úÂëÖØÓõÄʾÀý£ºÕâ¾ÍÊDZ»µ÷ÓõÄÄÚÈÝ£ºÄúºÃ!ʹÓÃrequireº¯ÊýʵÏֵġ£
2) include()º¯Êý
ʹÓÃinclude()°üº¬ÍⲿphpÎļþʱ£¬Ö»ÓÐ×ÔÉíphpÎļþÖ´Ðе½include()º¯Êýʱ²Å½«ÍⲿÎļþ°üº¬½øÀ´£¬²¢ÇÒµ±Ëù°üº¬µÄÍⲿÎļþ·¢Éú´íÎóʱ£¬ÏµÍ³Ö»¸ø³öÒ»¸ö¾¯¸æ£¬phpÎļþ¼ÌÐøÏòÏÂÖ´ÐС£
ʾÀý£º
µ÷ÓÃÎļþconfig2.incµÄ³ÌÐò´úÂ룺
<?php echo " includeº¯ÊýµÄʹÓÃ, ·Ç³£¼òµ¥! " ; ?>
µ±Ç°½Å±¾example02.phpµÄ³ÌÐò´úÂ룺
<?php
echo "´úÂëÖØÓõÄʾÀý2 : " ;
include ( ' config2.inc ' ) ; //µ÷ÓÃÁíÍâÒ»¸öÎļþconfig2.inc,Êä³öconfig2.incÖеÄÄÚÈÝ
echo "<br>" ;
echo " ʹÓÃincludeº¯ÊýʵÏÖµÄ. " ; ?>
½á¹ûΪ£º´úÂëÖØÓõÄʾÀý2: includeº¯ÊýµÄʹÓÃ,·Ç³£¼òµ¥! ʹÓÃincludeº¯ÊýʵÏֵġ£
ͨ¹ýÊäÈëÒª°üº¬ÎļþµÄÍêÕû·¾¶»òÕßÏà¶Ô·¾¶£¬¿ÉÒÔÖ¸¶¨Ã÷È·µÄ·¾¶¡£
ʾÀý£º
include ('D: \ webpage\ mr\ sl\ 40.php' ) ;
include (' .. \ sl \ 40.php ' ) ;
include ( ' 40.php' ) ;
Èç¹ûûÓÐÖ¸¶¨Ã÷È·µÄ·¾¶£¬×ÔÉíPHPÎļþ¾ÍÔÚµ±Ç°Ä¿Â¼ÖвéÕÒ°üº¬µÄÎļþ£¬È»ºó²éÕÒphp.iniÎļþÖеÄinclude_pathÉèÖÃÖÐÁгöµÄĿ¼¡£
php.iniÎļþÖеÄinclude_pathÉèÖÃÈçÏ£º
nclude_path=". : / usr / local / lib / php : home / httpd / globalincs "
include_path=" . ; C: \php5 " ; UNIX : " / path1: /path2" Windows : " \path1; \ path2"
×¢Ò⣺ÔÚÉèÖÃinclude_pathʱ£¬ÔÚUnix֮Ϸָô×Ö·ûʹÓÃðºÅ£¨£º£©£¬¶øWindowsÏ·ָô·ûʹÓ÷ֺţ¨£»£©¡£ÔÚ¶Ôinclude_pathÉèÖÃÍê³ÉÖ®ºó£¬Òª±£´æphph.iniÎļþ£¬ÖØÐÂÆô¶¯Apache·þÎñÆ÷ºó²ÅÓÐЧ¡£
ÔÚʹÓÃinclude
Ïà¹ØÎĵµ£º
»ùÓÚPHPµÄÍøÉÏÉ̳ǹÜÀíÐÅϢϵͳ·ÖÎöÓëÉè¼Æ
Ò»¡¢ (±³¾°½éÉÜ)Ñ¡ÌâÒÀ¾Ý¼°¼ÛÖµ£º
2008ÄêÏ°ëÄê,È«ÇòÐԵĽðÈÚΣ»ú±¬·¢,ÂûÑÓÖÁ¸÷¸ö²úÒµ¼°ÁìÓò,Õâ´Î¾¼ÃµÄ´óÏôÌõÈÃÎÒ¿´µ½µÄÊÇ»úÓö,ÖйúÔÚÕâ´Î¾¼ÃΣ»úÖÐÏÔʾÁ˲»·²µÄʵÁ¦Ó뷢չDZÁ¦,µ±ÆóÒµÃæÁÙÀ§¾³µÄʱºò,×îÏÈÏëµ½µÄÊÇÈçºÎËõ¼õÉÌÒµ³É±¾,±ÈÈç²ÃÔ±½µÐ½,Ëæ×ÅÍøÂç ......
<?php
/**
* Mysql DB
*
* @author Administrator
* @package defaultPackage
*/
class MySqlDB{
private $_db;
private static $_instance;
private function __construct(&$db_type){
global $connectionstr;
$conn_db=$connectionstr[$db_type];
$this->_db=mysql_pconnect($conn ......
Èç¹ûËùÓеÄClass¶¼Ó¦¸Ã´æÔÚÓÚÒ»¸öĬÈϵIJ㼶ÖеĻ°£¬ÄÇô×²ãÓ¦¸ÃÊÇ×îΪһ°ãµÄClass£¬Ò²¾ÍÊÇ˵¼«Îª³éÏóµÄ£¬Ã¿Ò»¸öϲãµÄClass¾ù±ÈÆäÉϲã
µÄClass£¨¼´¸¸Àࣩ¸ü¼ÓרÃÅ»¯¡£»ùÓÚ¸Ã˼Ï룬ÔÚPHPÖУ¬Õâ¸ö¶¥²ãµÄClass±»ÃüÃûΪ“stdClass”£¬ÇÒ×÷Ϊһ¸ö“Standard
Class”£¬Äã¿ÉÒÔ°ÑËü¿´³ÉÊÇÒ ......
²É¼¯ÒѾ²»ÊÇʲôÐÂÃû´ÊÁË,ºÜ¶àÕ¾³¤ÎªÁËÊ¡ÊÂ,Ò²¾ÖÏÞÓÚÈËÁ¦µÄȱ·¦,ʹÓóÌÐòÀ´¸ø×Ô¼º
µÄÍøÕ¾Ìíש¼ÓÍß,±ÈÈç±¾È˵ĸöÈËÍøÕ¾Î÷Î÷¸¥Ë¹ÍøÒ²²É¼¯ÁË´óÁ¿µÄÐÂÎÅ,ÄÇôÈç¹ûʵÏÖÄØ?½ñÌìÎÒÃÇÔËÓÃphpÀ´ÊµÏÖÕâ¸ö¹¦ÄÜ.
̸µ½²É¼¯,ÎÒÃDz»µÃ²»ËµÁ½¸ö¶«Î÷,µÚÒ»¸öÊÇÈçºÎ»ñÈ¡Ô¶³ÌÍøÕ¾µÄÔ´´úÂë,Õâ¸ö¿ÉÒÔͨ¹ýphpµÄÒ»¸öÀ© ......
http://hi.baidu.com/honfei/blog/item/5e992bfb2704542b4f4aea1a.html
NuSoap½éÉÜ (phpµ÷ÓÃwebservice)
2009Äê07ÔÂ04ÈÕ ÐÇÆÚÁù 09:41
NuSOAP ÊÇ PHP »·¾³Ï嵀 WEB ·þÎñ±à³Ì¹¤¾ß£¬ÓÃÓÚ´´½¨»òµ÷Óà WEB ·þÎñ¡£ËüÊÇÒ»¸ö¿ªÔ´Èí¼þ£¬µ±Ç°°æ±¾ÊÇ 0.7.2 £¬Ö§³Ö SOAP1.1 ¡¢ WSDL1.1 £¬¿ÉÒÔÓëÆäËûÖ§³Ö SOAP1.1 ºÍ WSDL1.1 µÄ ......