½ñÌìÏëʹÓÃÕâÒ»¾äphpÀ´ÅжÏÒ»¸öÎļþÊÇ·ñ´æÔÚ£º echo is_file('/var/downloads/donkey/incoming/[µ±µØÇòֹͣת¶¯].The.Day.The.Earth.Stood.Still.DVDRip.XviD-DMT.avi')?"true":"false";
echo is_file('/var/downloads/donkey/incoming/[µ±µØÇòֹͣת¶¯].The.Day.The.Earth.Stood.Still.DVDRip.XviD-DMT.avi')?"true":"false"; ½á¹û×ÜÊDZ¨false ¹À¼ÆÔÒòÊÇphpµÄ±àÂë¸ñʽºÍ²Ù×÷ϵͳµÄÎļþÃû±àÂë¸ñʽ²»Í³Ò»£¬ËùÒԾͳ¬ÊÐʹÓÃÈçÏÂÓï¾ä£º echo is_file(iconv('UTF-8','GB2312','/var/downloads/donkey/incoming/[µ±µØÇòֹͣת¶¯].The.Day.The.Earth.Stood.Still.DVDRip.XviD-DMT.avi'))?"true":"false";
echo is_file(iconv('UTF-8','GB2312','/var/downloads/donkey/incoming/[µ±µØÇòֹͣת¶¯].The.Day.The.Earth.Stood.Still.DVDRip.XviD-DMT.avi'))?"true":"false"; ½á¹û³É¹¦£¬µ«ÊÇÕÒÀ´ÕÒÈ¥£¬ÕÒ²»µ½php»ñµÃ²Ù×÷ϵͳĬÈϱàÂë¸ñʽµÄº¯Êý£¬ËùÒÔÖ»ÄÜдËÀÁË¡£ ......
Ä¿Ç°£¬×î³£ÓõÄÈýÖÖ¶¯Ì¬ÍøÒ³ÓïÑÔÓÐASP(Active Server Pages),JSP(Java Server Pages),
PHP (Hypertext Preprocessor)¡£
¼ò ½é
¡¡¡¡ASPÈ«ÃûActive Server Pages£¬ÊÇÒ»¸öWEB·þÎñÆ÷¶ËµÄ¿ª·¢»·¾³£¬ ÀûÓÃËü¿ÉÒÔ²úÉúºÍÔË
Ðж¯Ì¬µÄ¡¢½»»¥µÄ¡¢¸ßÐÔÄܵÄWEB·þÎñÓ¦ÓóÌÐò¡£ASP²ÉÓýű¾ÓïÑÔVB Script£¨Java script
£©×÷Ϊ×Ô¼ºµÄ¿ª·¢ÓïÑÔ¡£
¡¡¡¡PHPÊÇÒ»ÖÖ¿çƽ̨µÄ·þÎñÆ÷¶ËµÄǶÈëʽ½Å±¾ÓïÑÔ. Ëü´óÁ¿µØ½èÓÃC,JavaºÍPerlÓïÑÔµÄÓï·¨
, ²¢ñîºÏPHP×Ô¼ºµÄÌØÐÔ,ʹWEB¿ª·¢ÕßÄܹ»¿ìËÙµØд³ö¶¯Ì¬Éú³ÉÒ³Ãæ.ËüÖ§³ÖÄ¿Ç°¾ø´ó¶àÊýÊý
¾Ý¿â¡£»¹ÓÐÒ»µã£¬PHPÊÇÍêÈ«Ãâ·ÑµÄ£¬²»Óû¨Ç®£¬Äã¿ÉÒÔ´ÓPHP¹Ù·½Õ¾µã(http://www.php.ne
t)×ÔÓÉÏÂÔØ¡£¶øÇÒÄã¿ÉÒÔ²»ÊÜÏÞÖƵػñµÃÔ´Â룬ÉõÖÁ¿ÉÒÔ´ÓÖмӽøÄã×Ô¼ºÐèÒªµÄÌØÉ«¡£
¡¡¡¡JSP ÊÇSun ......
Ä¿Ç°£¬×î³£ÓõÄÈýÖÖ¶¯Ì¬ÍøÒ³ÓïÑÔÓÐASP(Active Server Pages),JSP(Java Server Pages),
PHP (Hypertext Preprocessor)¡£
¼ò ½é
¡¡¡¡ASPÈ«ÃûActive Server Pages£¬ÊÇÒ»¸öWEB·þÎñÆ÷¶ËµÄ¿ª·¢»·¾³£¬ ÀûÓÃËü¿ÉÒÔ²úÉúºÍÔË
Ðж¯Ì¬µÄ¡¢½»»¥µÄ¡¢¸ßÐÔÄܵÄWEB·þÎñÓ¦ÓóÌÐò¡£ASP²ÉÓýű¾ÓïÑÔVB Script£¨Java script
£©×÷Ϊ×Ô¼ºµÄ¿ª·¢ÓïÑÔ¡£
¡¡¡¡PHPÊÇÒ»ÖÖ¿çƽ̨µÄ·þÎñÆ÷¶ËµÄǶÈëʽ½Å±¾ÓïÑÔ. Ëü´óÁ¿µØ½èÓÃC,JavaºÍPerlÓïÑÔµÄÓï·¨
, ²¢ñîºÏPHP×Ô¼ºµÄÌØÐÔ,ʹWEB¿ª·¢ÕßÄܹ»¿ìËÙµØд³ö¶¯Ì¬Éú³ÉÒ³Ãæ.ËüÖ§³ÖÄ¿Ç°¾ø´ó¶àÊýÊý
¾Ý¿â¡£»¹ÓÐÒ»µã£¬PHPÊÇÍêÈ«Ãâ·ÑµÄ£¬²»Óû¨Ç®£¬Äã¿ÉÒÔ´ÓPHP¹Ù·½Õ¾µã(http://www.php.ne
t)×ÔÓÉÏÂÔØ¡£¶øÇÒÄã¿ÉÒÔ²»ÊÜÏÞÖƵػñµÃÔ´Â룬ÉõÖÁ¿ÉÒÔ´ÓÖмӽøÄã×Ô¼ºÐèÒªµÄÌØÉ«¡£
¡¡¡¡JSP ÊÇSun ......
Ä¿Ç°£¬×î³£ÓõÄÈýÖÖ¶¯Ì¬ÍøÒ³ÓïÑÔÓÐASP(Active Server Pages),JSP(Java Server Pages),
PHP (Hypertext Preprocessor)¡£
¼ò ½é
¡¡¡¡ASPÈ«ÃûActive Server Pages£¬ÊÇÒ»¸öWEB·þÎñÆ÷¶ËµÄ¿ª·¢»·¾³£¬ ÀûÓÃËü¿ÉÒÔ²úÉúºÍÔË
Ðж¯Ì¬µÄ¡¢½»»¥µÄ¡¢¸ßÐÔÄܵÄWEB·þÎñÓ¦ÓóÌÐò¡£ASP²ÉÓýű¾ÓïÑÔVB Script£¨Java script
£©×÷Ϊ×Ô¼ºµÄ¿ª·¢ÓïÑÔ¡£
¡¡¡¡PHPÊÇÒ»ÖÖ¿çƽ̨µÄ·þÎñÆ÷¶ËµÄǶÈëʽ½Å±¾ÓïÑÔ. Ëü´óÁ¿µØ½èÓÃC,JavaºÍPerlÓïÑÔµÄÓï·¨
, ²¢ñîºÏPHP×Ô¼ºµÄÌØÐÔ,ʹWEB¿ª·¢ÕßÄܹ»¿ìËÙµØд³ö¶¯Ì¬Éú³ÉÒ³Ãæ.ËüÖ§³ÖÄ¿Ç°¾ø´ó¶àÊýÊý
¾Ý¿â¡£»¹ÓÐÒ»µã£¬PHPÊÇÍêÈ«Ãâ·ÑµÄ£¬²»Óû¨Ç®£¬Äã¿ÉÒÔ´ÓPHP¹Ù·½Õ¾µã(http://www.php.ne
t)×ÔÓÉÏÂÔØ¡£¶øÇÒÄã¿ÉÒÔ²»ÊÜÏÞÖƵػñµÃÔ´Â룬ÉõÖÁ¿ÉÒÔ´ÓÖмӽøÄã×Ô¼ºÐèÒªµÄÌØÉ«¡£
¡¡¡¡JSP ÊÇSun ......
isset() ¡¾1¡¿
Returns TRUE if var
exists and has value other
than NULL, FALSE otherwise.
ÊäÈë¿ÉÒÔÊǶà¸ö±äÁ¿£¬Ö»ÓÐËùÓеıäÁ¿ÎªÕæµÄʱºò£¬·µ»ØÕæ
empty()¡¾2¡¿
Returns FALSE if var
has a non-empty
and non-zero value.
The following things are considered to be empty:
"" (an empty string)
0 (0 as an integer)
"0" (0 as a string)
NULL
FALSE
array() (an empty array)
var $var; (a variable declared, but without a
value in a class)
ÊäÈëÖ»ÄÜÊÇÒ»¸ö±äÁ¿
is_null() ¡¾3¡¿
Returns TRUE if var is
null , FALSE
otherwise.
A variable is considered to be null if:
it has been assigned the constant NULL.
it has not been set to any value yet.
it has been unset().
ʹÓà PHP º¯Êý¶Ô±äÁ¿ $x ½øÐбȽÏ
±í´ïʽgettype()empty()is_null()isset()if($x) Boolean
$x = "";
string
TRUE
FALSE
TRUE
FALSE
$x = null;
NULL
TRUE
TRUE
FALSE
FALSE
var $x;
NULL
TRUE
TRUE
FALSE
FALSE
$x is undefined
NU ......
PHP×÷ΪһÖÖ·þÎñÆ÷¶ËµÄ½Å±¾ÓïÑÔ£¬Ïó±àд¼òµ¥£¬»òÕßÊǸ´ÔӵĶ¯Ì¬ÍøÒ³ÕâÑùµÄÈÎÎñ£¬ËüÍêÈ«Äܹ»Ê¤ÈΡ£µ«ÊÂÇé²»×ÜÊÇÈç´Ë£¬ÓÐʱΪÁËʵÏÖij¸ö¹¦ÄÜ£¬±ØÐë½èÖúÓÚ
²Ù×÷ϵͳµÄÍⲿ³ÌÐò£¨»òÕß³Æ֮ΪÃüÁ£¬ÕâÑù¿ÉÒÔ×öµ½Ê°빦±¶¡£
¡¡¡¡ÄÇô£¬ÊÇ·ñ¿ÉÒÔÔÚPHP½Å±¾Öе÷ÓÃÍⲿÃüÁîÄØ£¿Èç¹ûÄÜ£¬ÈçºÎÈ¥×öÄØ£¿
ÓÐЩʲô·½ÃæµÄ¹ËÂÇÄØ£¿ÏàÐÅÄã¿´Á˱¾Îĺ󣬿϶¨Äܹ»»Ø´ðÕâЩÎÊÌâÁË¡£
ÊÇ·ñ¿ÉÒÔ£¿
¡¡¡¡´ð°¸Êǿ϶¨µÄ¡£PHPºÍÆäËüµÄ³ÌÐòÉè
¼ÆÓïÑÔÒ»Ñù£¬ÍêÈ«¿ÉÒÔÔÚ³ÌÐòÄÚµ÷ÓÃÍⲿÃüÁ²¢ÇÒÊǺܼòµ¥µÄ£ºÖ»ÒªÓÃÒ»¸ö»ò¼¸¸öº¯Êý¼´¿É¡£
Ç°ÌáÌõ¼þ
¡¡¡¡ÓÉÓÚPHP»ù±¾ÊÇ
ÓÃÓÚWEB³ÌÐò¿ª·¢µÄ£¬ËùÒÔ°²È«ÐÔ³ÉÁËÈËÃÇ¿¼ÂǵÄÒ»¸öÖØÒª·½Ãæ¡£ÓÚÊÇPHPµÄÉè¼ÆÕßÃǸøPHP¼ÓÁËÒ»¸öÃÅ£º°²È«Ä£Ê½¡£Èç¹ûÔËÐÐÔÚ°²È«Ä£Ê½Ï£¬ÄÇôPHP½Å
±¾Öн«Êܵ½ÈçÏÂËĸö·½ÃæµÄÏÞÖÆ£º
Ö´ÐÐÍⲿÃüÁî
ÔÚ´ò¿ªÎļþʱÓÐЩÏÞÖÆ
Á¬½ÓMySQLÊý¾Ý¿â
»ùÓÚHTTPµÄÈÏÖ¤
¡¡
¡¡ÔÚ°²È«Ä£Ê½Ï£¬Ö»ÓÐÔÚÌض¨Ä¿Â¼ÖеÄÍⲿ³ÌÐò²Å¿ÉÒÔ±»Ö´ÐУ¬¶ÔÆäËü³ÌÐòµÄµ÷Óý«±»¾Ü¾ø¡£Õâ¸öĿ¼¿ÉÒÔÔÚphp.iniÎļþÖÐÓÃ
safe_mode_exec_dirÖ¸Á»òÔÚ±àÒëPHPÊǼÓÉÏ--with-exec-dirÑ¡ÏîÀ´Ö¸¶¨£¬Ä¬ÈÏÊÇ/usr/local/php
/bin¡£
Èç¹ûÄãµ÷ÓÃÒ»¸öÓ¦¸Ã¿ÉÒÔÊä³ö½á¹ûµÄÍⲿÃüÁÒâ˼ÊÇ ......
Ç°ÑÔ£º
¡¡¡¡¶àÓïÑÔÍøÕ¾¿ª·¢£¬ÖصãµÄ»¹ÊÇÔÚ½â¾öÓïÑÔÖ®¼äµÄÎÊÌâ¡£
¡¡¡¡ÄÇÈçºÎ½â¾öÕâ¸öÎÊÌâÄØ?´ó¸Å¾Í·ÖÈý²½×ߣº
¡¡¡¡1.Ò³Ãæ¶àÓïÑÔ
¡¡¡¡2.Êý¾Ý¿â¶àÓïÑÔ
¡¡¡¡3.Óû§·ÃÎÊÓïÑÔͳһ
¡¡¡¡1.Ò³Ãæ¶àÓïÑÔ
¡¡¡¡ÐèÒª¿¼ÂǵÄÎÊÌ⣺
¡¡¡¡A.Óû§µÇ½ʱºò£¬×Ô¶¯Ê¶±ð×Ö·û£¬µ÷Óò»Í¬µÄÓïÑÔ°ü?
¡¡¡¡B.Óû§Çл»²»Í¬ÓïÑÔʱºò£¬µ÷Óò»Í¬µÄÓïÑÔ°ü?
¡¡¡¡C.Ôö¼Ó¶àÓïÑÔºóµÄĿ¼½á¹¹?
¡¡¡¡Ò³Ãæ¶àÓïÑÔÒ²¾ÍÊÇÍâ¹ÛµÄ¶àÓïÑÔ»¯£¬ÕâÀï¿ÉÒÔ²ÉÓþ²Ì¬µÄÓïÑÔ°üµÄ·½Ê½¡£
¡¡¡¡Éè¼Æʱºò¾ÍÓ¦¸Ã°üÀ¨languageµÄĿ¼£¬Õë¶Ô²»Í¬ÓïÑÔÓжÀÁ¢µÄ×ÓĿ¼¡£
¡¡¡¡ÈçÓ¢ÎÄlanguage/en ,¼òÌåÖÐÎÄlanguage/gb,·±ÌåÖÐÎÄlanguage/b5 (¿ÉÒÔÀ©Õ¹ÆäËûÓïÑÔ)
¡¡¡¡Ã¿¸öĿ¼Ï¾Ͱüº¬Á˶Ôÿ¸öÒ³ÃæµÄÓïÑÔ°æ±¾¡£Ñ¡ÔñÓïÑ԰汾ʱºò¾Í¿ÉÒÔµ÷ÓÃÏàÓ¦°æ±¾µÄÓïÑÔ°ü¡£
¡¡¡¡¾ßÌå×ö·¨£º
¡¡¡¡0.ÀûÓÃjsÓïÑÔ£¬Ê¶±ðä¯ÀÀÆ÷ÓïÑÔ£¬ÔÚµ÷Óò»Í¬µÄÓïÑÔ°ü.
¡¡¡¡1.language/en/global.lnÊÇÕë¶ÔÓ¢ÎÄ°æµÄÈ«¾ÖÓïÑÔ°ü¡£
¡¡¡¡2.global.ln ÄÚÈÝΪ£º
¡¡¡¡$title = "English webstie";
¡¡¡¡$charset = "UTF-8";
¡¡¡¡3.index.phpµ÷Óãº
¡¡¡¡<?php
¡¡¡¡require_once()
¡¡¡¡?>;
¡¡¡¡<html>;
¡¡¡¡<head>;
¡¡¡¡<title>;$title<title& ......
֮ǰPHPʵÏÖ¶àÓïÑÔ¹ú¼Ê»¯£¬´ó²¿·Ö¶¼»á²ÉÓðÑÓïÑÔÖ±½ÓÌá³öÀ´×÷ΪÊý×éÀ´µ÷Óã¬ÀýÈç±È½ÏÓÐÃûphpMyadmin£¬discuzµÈÖªÃû¿ªÔ´ÏµÍ³£¬²»¹ý£¬ÕâÀï½éÉÜÈçºÎͨ¹ýgettext£¬¼´ÓÃ×ÊÔ´ÎļþÀ´ÊµÏÖ¡£µäÐ͵ÄCMS°¸Àý-wordpressÒ²ÊÇͨ¹ýËüʵÏÖµÄÓïÑÔ¹ú¼Ê»¯£¬ÏÂÃæÀ´ËµÏÂphpÖÐÈçºÎÀ´ÀûÓÃÅäÖÃÎļþʵÏÖ¹ú¼Ê»¯µÄ¡£
Ê×ÏȽéÉÜÏÂ.MOÎļþ£¬ÔÚPHPÖÐÊÇÀûÓÃ.MOÎļþÀ´×öÓïÑÔ°üʵÏֵģº
PO ÊÇ Portable Object (¿ÉÒÆÖ²¶ÔÏó)µÄËõдÐÎʽ£»
MO ÊÇ Machine Object (»úÆ÷¶ÔÏó) µÄËõдÐÎʽ¡£
PO ÎļþÊÇÃæÏò·ÒëÈËÔ±µÄ¡¢ÌáÈ¡ÓÚÔ´´úÂëµÄÒ»ÖÖ×ÊÔ´Îļþ¡£µ±Èí¼þÉý¼¶µÄʱºò£¬Í¨¹ýʹÓà gettext Èí¼þ°ü´¦Àí PO Îļþ£¬¿ÉÒÔÔÚÒ»¶¨³Ì¶ÈÉÏʹ·Òë³É¹ûµÃÒԼ̳У¬¼õÇá·ÒëÈËÔ±µÄ¸ºµ£¡£MO ÎļþÊÇÃæÏò¼ÆËã»úµÄ¡¢ÓÉ PO Îļþͨ¹ý gettext Èí¼þ°ü±àÒë¶ø³ÉµÄ¶þ½øÖÆÎļþ¡£³ÌÐòͨ¹ý¶ÁÈ¡ MO Îļþʹ×ÔÉíµÄ½çÃæת»»³ÉÓû§Ê¹ÓõÄÓïÑÔ¡£
ͨ³£ÈËÃÇд³ÌÐòʱ¶¼Êǽ«ÎÄ×ÖдËÀÔÚ³ÌÐòÀïµÄ£¬±ÈÈ磺echo “Hello World!”; £¬¼ÙÈçÒª¸Ä³ÉËü¹úÓïÑÔ£¬Ð´¹ú¼Ê»¯³ÌÐò£¬¾ÍÒªÖð¸ö´ò¿ª½øÐÐÐ޸ģ¬³ÌÐò½Ï¶Ìʱ»¹ÐУ¬Èô³ÌÐòÓÐÉÏÍòÉõÖÁ¸ü¶à£¬¸ÄÆðÀ´¾Í²»ÊÇÄÇôÈÝÒ×ÁË¡£½üÀ´Ëæ×Å i18n£¨internationalizationµÄËõд£¬¿ªÍ·×ÖĸiºÍ½áβ×ÖĸnµÄÖмäÒ»¹²18¸ö×Ö·û£¬Ó ......