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

php ʹÓÃÃüÁîÐÐ×Ô±äÁ¿

php ʹÓÃÃüÁîÐÐ×Ô±äÁ¿
ÔÚÃüÁîÐÐÀïÊäÈë³ÌÐò²ÎÊýÀ´¸ü¸ÄÆäÔËÐз½Ê½ÊǺܳ£¼ûµÄ×ö·¨¡£ÄãÒ²¿ÉÒÔ¶ÔCLI³ÌÐòÕâÑù×ö¡£PHP
CLI´øÓÐÁ½¸öÌØÊâµÄ±äÁ¿£¬×¨ÃÅÓÃÀ´´ïµ½Õâ¸öÄ¿µÄ£ºÒ»¸öÊÇ$argv±äÁ¿£¬Ëüͨ¹ýÃüÁîÐаѴ«µÝ¸øPHP½Å±¾µÄ²ÎÊý±£´æΪµ¥¶ÀµÄÊý×éÔªËØ£»ÁíÒ»¸ö
ÊÇ$argc±äÁ¿£¬ËüÓÃÀ´±£´æ$argvÊý×éÀïÔªËصĸöÊý¡£
    ÓÃPHP½Å±¾±àдһ¶Î¶ÁÈ¡$argv²¢´¦ÀíËüËùº¬²ÎÊýµÄ´úÂëÊǺܼòµ¥µÄ¡£ÊÔÊÔÁбíBÀïµÄʾÀý½Å±¾£¬¿´¿´ËüÊÇÈçºÎ¹¤×÷µÄ£º
ÁбíB
<?php
    print_r($argv);
?>
Run this script by passing it some arbitrary values, and check the output:
shell> /path/to/phptest.php chocolate 276 "killer tie, dude!"
Array
(
    [0] => test.php
    [1] => chocolate
    [2] => 276
    [3] => killer tie, dude!
)
ÕýÈçÄã¿ÉÒÔ´ÓÊä³öµÄ½á¹û¿´µ½µÄ£¬´«µÝ¸øtest.phpµÄÖµ»á×Ô¶¯µØ×÷ΪÊý×éÔªËسöÏÖÔÚ$argvÀҪעÒâµÄÊÇ£¬$argvµÄµÚÒ»¸ö×Ô±äÁ¿×ÜÊǽű¾×Ô¼ºµÄÃû³Æ¡£
    ÏÂÃæÊÇÒ»¸ö¸ü¼Ó¸´ÔÓµÄÀý×Ó£¨ÁбíC£©£º
ÁбíC
<?php
// check for all required arguments
// first argument is always name of script!
if ($argc != 4) {
    
die("Usage: book.php <check-in-date> <num-nights> <room-type>
");
}
// remove first argument
array_shift($argv);
// get and use remaining arguments
$checkin = $argv[0];
$nights = $argv[1];
$type = $argv[2];
echo "You have requested a $type room for $nights nights, checking in on $checkin. Thank you for your order!
";
?>
    ÏÂÃæÊÇÆäÓ÷¨µÄʾÀý£º
shell> /path/to/phpbook.php 21/05/2005 7 single
You have requested a single room for 7 nights, checking in on 21/05/2005. Thank you for your order!
    ÔÚÕâÀ½Å±¾Ê×ÏÈ»á¼ì²é$argc£¬ÒÔÈ·±£×Ô±äÁ¿µÄÊýÁ¿·ûºÏÒªÇó¡£ËüÈ»ºó»á´Ó$argvÀïÌáÈ¡³öÿһ¸ö×Ô±äÁ¿£¬°ÑËüÃÇ´òÓ¡Êä³öµ½±ê×¼µÄÊä³öÉ豸ÉÏ¡£


Ïà¹ØÎĵµ£º

³ÏÕУºPHP³ÌÐòÔ±£¨º¼ÖÝ£©


¾ßÌåÒªÇó£º
1¡¢Ñ§Àú²»ÏÞ£¬¾ßÓÐ1ÄêÒÔÉÏPHP¿ª·¢¾­Ñ飬ÓдóÐÍÍøÕ¾¹¤×÷¾­Ñ飻
2¡¢ÊìϤ mysql£¬°üÀ¨Êý¾Ý¿âÉè¼Æ,ËÙ¶ÈÓÅ»¯£»
3¡¢ÊìϤJavaScript£¬XML£¬ajax£¬¾«Í¨Div+CSS£»
4¡¢¶Ô»¥ÁªÍøµÄ¼¼ÊõÓнÏÈ«ÃæÀí½â£¬ÄܶÀÁ¢Ó¦¸¶´ó·ÃÎÊÁ¿ÏÂÍøÕ¾µÄÉè¼ÆºÍ¿ª·¢¹¤×÷£»
5¡¢¾ßÓÐPHP»º´æ¼¼Êõ¡¢¾²Ì¬»¯Éè¼Æ·½ÃæµÄ¾­Ñ飬Äܹ»¶ÀÁ¢¿ª·¢ºǫ́£»
6 ......

ÕÒÈËÒ»ÆðÍæphp£¬ºÃÄÑ

ÒòΪÎÒÔÚ¹úÍâΪ¶à£¬ÔÚ¹úÄÚÓеãÊ£¬Ò²²»ÖªµÀÉÏʲôÍø±È½ÏºÃ¡£Ïë°Ñ×Ô¼ºµÄ·¿×Ó×â³öÈ¥£¬Ëæ±ãÕÒÁËÒ»¸öʲôÍø·¢²¼ÁËһϣ¬Á½Ìì¾Í×â³öÈ¥ÁË£»¿ÉÏëÕÒphper£¬²»Ôõô³É¹¦¡£Ç°ÄêÊÇ°ïÅóÓÑÕÒ£¬ÓÃÁ˲»ÉÙÇþµÀ£¬µ«Ã»ÉÏcsdn£¬Ã»³É¡£ÏÖÔÚΪ×Ô¼º£¬Ï£ÍûÄÜÕÒµ½ºÏÊʵġ£µ±È»ÕÐÈ˸ú×â·¿²»Ò»Ñù£¬ÄÑÒ»µã²»Ææ¹Ö¡£phpers°¡£¬¿ìÀ´°É... ......

ÔÚwindows7ÖдApache+PHP+MySQLƽ̨

½ñÌì¸ãÁËÒ»ÏÂÎ磬ÔÚµçÄÔÉϴÁËAPMƽ̨
ϵͳ:Windows7 Professional EN
Apache2.2.9:http://archive.apache.org/dist/httpd/binaries/win32/apache_2.2.9-win32-x86-openssl-0.9.8h-r2.msi
PHP5.3.1:http://windows.php.net/downloads/releases/php-5.3.1-Win32-VC6-x86.zip
MySQL5.1.42:http://ftp.iij.ad.jp/pub/db/ ......

Äã¿ÉÒÔϲ»¶PHP£¬µ«ÊÇÄã²»ÄÜÈö»Ñ£¡

×î½üÎÒÕæÊÇÍ·´óÒÓ£¬ÎҵIJ©¿ÍÀï¾ÓȻһҹ¼ä±ä³ÉÁËphpºÍaspµÄ¶·Õù³¡£¬ÉõÖÁ±ä³ÉÁËwindowsºÍlinuxµÄ¶·Õù³¡¡£ÕæÊÇÒâÏë²»µ½µÄ¡£
ÎÒ±¾À´ÎÞÒâÌôÆðwindowsºÍlinuxÖ®¼äµÄÕù¶Ë£¬¶øÇÒÒ²·Ç³£²»ÏëÈ¥ÌôÕâÖÖÕù¶Ë¡£
»°Ëµ£¬ÆäʵÎÒ±¾Éí¶Ôlinux²Ù×÷ϵͳÊÇûÓÐʲô»µÓ¡ÏóµÄ£¬ËäÈ»×Ô¼ºµÄµçÄÔÉÏûÓÐ×°¹ýlinux£¬µ«ÊÇÔÚͬѧµÄµçÄÔÉÏÓùý£¬¾õµÃËüͦºÃ ......

PHPÈçºÎ¶ÔSESSIONÐòÁл¯£¨SESSION¶ÔÏó´¦Àí£©

這個問題ÓÐ點Ææ¹Ö£¬ÔÚJavaºÍ.netµÄÊÀ½ç裡還δÅöµ½過.......
¿´來PHP對對ÏóµÄÖ§³Ö還²»ÊÇÌ«ÓѺ㬺ǺÇ~~~
[轉載춣º] http://blog.csdn.net/yehell/archive/2007/12/19/1953826.aspx
½ñÌìÔÚphpÎļþÖÐÉèÖÃÁËÒ»¸ösession.²¢½«Ò»¸öÀ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ