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

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


Ïà¹ØÎĵµ£º

[ת]UbuntuÏÂphp¿ª·¢»·¾³ÅäÖÃ(XAMPP)

UbuntuÎÞÒÉÊÇlinux³õѧÕßµÄÊ×Ñ¡°æ±¾£¬ÒòΪËüͼÐνçÃæÖ§³ÖµÄ·Ç³£ºÃ¡£
È»¶øxammpÊÇphp³õѧÕßµÄÊ×Ñ¡¡£
1.ʲôÊÇxammp?
XAMPP£¨Apache+MySQL+PHP+PERL£©ÊÇÒ»¸ö¹¦ÄÜÇ¿´óµÄ½¨Õ¾¼¯³ÉÈí¼þ°ü¡£Õâ¸öÈí¼þ°üÔ­À´µÄÃû×ÖÊÇLAMPP£¬µ«ÊÇΪÁ˱ÜÃâÎó½â£¬×îеļ¸¸ö°æ±¾¾Í¸ÄÃûΪ XAMPP ÁË¡£Ëü¿ÉÒÔÔÚWindows¡¢Linux¡¢SolarisÈýÖÖ²Ù×÷ϵͳÏ°² ......

ÓÃÄ£°å¼¼ÊõʵÏÖPHP´úÂëºÍHMTL´úÂë·ÖÀë

1¡¢Ä£°åµÄÓÉÀ´
ÔÚûÓÐÄ£°å¼¼Êõ֮ǰ£¬Ê¹ÓÃPHP¿ª·¢³ÌÐò£¬Í¨³£¶¼ÊÇphp´úÂëºÍhtml»ì±àÔÚÒ»Æð¡£±ÈÈç˵ÐÂÎÅÁÐ±í£¬ºÜ¿ÉÄܾÍÊÇÒ»¸önewslist.phpÒ³Ã棬½á¹¹ÈçÏ£º
<?
//´ÓÊý¾Ý¿âÖжÁÈ¡³öÒªÏÔʾµÄÐÂÎżÇ¼
?>
<html>
<head>……..
</head>
<body>
<?
While ($news ......

PHP´éÍøÕ¾Ò»¸ö

ΪÁËÓ¦¸¶Êý×ÖýÌåʵ¼ùСѧÆÚ£¬ÓÃÁ½ÈýÌìµÄʱ¼ä´Ò´ÒææµØ¼ÜÆðÀ´Ò»¸öPHPÍøÕ¾¡£ÍøÕ¾ºÜ´é£¬ÀÏʦ¸øµÄ·ÖÊýÈÃËü¿´ÆðÀ´¸ü´é¡£
×öÕâ¸öÍøÕ¾µÄÄǶÎʱ¼äÕýºÃÔÚ¿´BrooksµÄÄDZ¾¿õÊÀ¾­µä¡¶ÈËÔÂÉñ»°¡·£¬Á˽âÁËÆäÖеēThe Surgical
Team”µÄ¿ª·¢Ä£Ê½£¬¾õµÃÔÚÌØÊⳡºÏÏ£¬ÕâÖÖ¿ª·¢Ä£Ê½È·Êµ»áÓµÓм«¸ßµÄ¿ª·¢Ð§ÂʺÍÍŶÓÕ½¶·Á¦¡£
Ò ......

¼ÌÐøÕª³­£º½ÌÄãÓÃPHPдMySQLÊý¾Ý¿âµÄÓû§ÈÏ֤ϵͳ

Óû§ÈÏÖ¤µÄÔ­ÀíºÜ¼òµ¥£ºÊ×ÏÈÐèÒªÓû§ÔÚÒ³ÃæÉÏÌîÈëÓû§ÃûºÍÃÜÂ룬µ±È»Ã»×¢²áµÄÓû§ÐèÒªÏÈ×¢²á¡£È»ºóµ÷ÓÃÊý¾Ý¿âËÑË÷ÊÇ·ñÓÐÏàÓ¦µÄÓû§¡£Èç¹ûÓоÍÈ·ÈÏ£¬Ã»ÓÐÔòÌáÐÑÓû§ÏÈ×¢²á¡£Ê¹ÓÃPHPÀ´Íê³ÉÕâÒ»Çкܼòµ¥£¬µ«ÐèҪעÒâµÄÊÇÈç¹ûÏëÔÚÒÔºóµÄÒ³ÃæÖж¼ÄÜÈ·ÈÏÓû§Éí·Ý¡£
µÚÒ»²½ÊÇ×öÒ»¸öµÇ¼µÄÒ³Ãæ¡£
µÚ¶þ²½¿ªÊ¼µÇ¼ºóµÄÈ·ÈϳÌÐòµÄÉ ......

PHPÊý×éµÄ×ܽá

 
Ò»¡¢Ê²Ã´ÊÇÊý×é
Êý×é¾ÍÊÇÒ»×éÊý¾ÝµÄ¼¯ºÏ£¬°ÑһϵÁÐÊý¾Ý×éÖ¯ÆðÀ´£¬ÐγÉÒ»¸ö¿É²Ù×÷µÄÕûÌå¡£Êý×éµÄÿ¸öʵÌ嶼°üº¬Á½Ï¼üºÍÖµ¡£
¶þ¡¢ÉùÃ÷Êý¾Ý
ÔÚPHPÖÐÉùÃ÷Êý×éµÄ·½Ê½Ö÷ÒªÓÐÁ½ÖÖ£ºÒ»ÊÇÓ¦ÓÃarray()º¯ÊýÉùÃ÷Êý×飬һÊÇÖ±½ÓΪÊý×éÔªËظ³Öµ¡£
<1>array()º¯ÊýÉùÃ÷µÄÊý×éµÄ·½Ê½array([mixed...]) ²ÎÊýmixedµÄÓ﷨Π......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ