PHPµÄÈýµã¾«»ª½éÉÜ
Perlµ±ÄêÈçºÎÔÚÉ̽ç³öÃû£¿ÆäÇ¿´óµÄÕýÔò±í´ïʽ¡£¶øPHPÄØ£¿ËûÊÇÒ»ÃÅ´ÓUnixÏ·¢Õ¹ÆðÀ´µÄÓïÑÔ£¬µ±È»Ò²¾Í¼Ì³ÐÁËPerlµÄºÜ¶àÌص㣬ͬʱCµÄÓŵ㶼ÓС£¿ìËÙ¡¢¼ò½à¡¢Ã÷ÁË£¬ÓÈÆäÊÇC³ÌÐòÔ±£¬PHPÊÇÖÁ°®£¬ÎÒ¾ÍÊÇÉî°®×Å“PHP”£¨¶¼ÍüÁËÅ®ÓÑÁË:)£©¡£ÕâÀÎÒÏëÀ´Ð´Ò»ÆªPHPµÄ±äÁ¿¡¢Êý×éÓ¦Óü¼ÇɺÍPHPµÄÕýÔò±í´ïʽ¡¢PHPµÄÄ£°åÓ¦Óã¬ÒÔºóÓÐʱ¼äÔÙдPHPÓëCOM¡¢PHPÓëXMLµÄÍêÈ«½áºÏ¡£
1¡¢±äÁ¿¡¢Êý×éµÄÓ¦Óü¼ÇÉ
(1)ºÜ¶àÈËÓõò»¶àµÄÊý×麯Êý¡£foreach¡¢list¡¢each¡£·Ö±ð¾Ù¼¸¸öÀý×Ó£¬Ó¦¸Ã¾ÍÄÜÖªµÀÁË¡£Àý£º
<?php
$data = array('a' => 'data1', 'b' => 'data2', 'c' => 'data3');
while(list($subscript, $value) = each($data))
{
echo "$subscript => $value :: ";
echo "$subscript => $value <br>";
}
reset($data);
foreach($data as $subscript => $value)
{
echo "$subscript => $value :: ";
echo "$subscript => $value <br>";
}
(2)º¯ÊýµÄ±äÁ¿¡¢±äÁ¿µÄ±äÁ¿¡¢±äÁ¿µÄ“Ö¸Õ딣º¿´ÏÂÀý£º
<?php
//±äÁ¿µÄ±äÁ¿
$var = "this is a var";
$varname = "var";
echo $$varname;
//º¯ÊýµÄ±äÁ¿
function fun1($str) {
echo $str;
}
$funname = "fun1";
$funname("This is a function !");
?>
±äÁ¿µÄ“Ö¸Õ딡£Õâ¸öÖ¸Õë¼ÓÉÏÁËË«ÒýºÅ£¬±íÃ÷Ëû²»ÊÇÕæÕýµÄÖ¸Õë¡£¿´¿´ÏÂÀý£º
<?php
function($a) {
$a ++;
}
$c = 0;
function($c);
echo $c; //$cÈÔΪ0
function(&$a) {
$a ++;
}
$c = 0;
echo $c; //$cΪ1
?>
Ö®ËùÒÔ³ÆÆäΪ“Ö¸Õ딣¬¾ÍÊÇÒòΪËûÓÐÁ˺ÍCÓïÑÔÖÐÖ¸ÕëÏàͬµÄ¹¦ÄÜ¡£µ«ÕâÓÖ²»ÊÇÕæÕýµÄÖ¸Õ룬ֻÄܹ»ÊÇÕâÑùµÄÈ¥Àí½â¡£
2¡¢ÕýÔò±í´ïʽ
ÕýÔò±í´ïʽÊÇÒ»¸ö·Ç³£´óµÄÌâÄ¿£¬PerlµÄÕýÔò±í´ïʽµÄÇ¿´óÊÇÎÅÁËÃûµÄ¡£¶øPHPÒ²²»Èõ£¬Ëû¼Ì³ÐÁËPerlµÄÕýÔò±í´ïʽ·¨Ôò£¬»¹ÓÐ×Ô¼ºµÄÒ»Ì×·¨Ôò¡£ÕâÀïֻ˵PHP×Ô¼ºµÄÕýÔò±í´ïʽ¡£
ÕýÔò±í´ïʽÊÇ×î»ù±¾µÄÔªËØ¡£¼òµ¥µ
Ïà¹ØÎĵµ£º
ÎÒÒ²ÊÇÒ»ASPתPHPµÄ³õѧÕߣ¬ÎÒÕâÀïÓÐÒ»ºÃµÄÍøÕ¾ÄÃÀ´Óë´ó¼ÒÒ»Æð·ÖÏí£¬Ï£Íû´ó¼Ò»áϲ»¶£¡
http://www.w3school.com.cn/
Ò²»¹ÓÐһЩºÃµÄÊÓƵҲÄÃÀ´Óë´ó¼ÒÒ»Æð·ÖÏí£¡
http://hi.baidu.com/ylinuxs/blog/item/4433d3354a58fed1a2cc2b26.html ......
#
Æô¶¯·þÎñµÄÓû§ºÍ×é
user
lighttpd lighttpd;
#
¿ª¶àÉÙ½ø³Ì
worker_processes
2;
#
´íÎóÈÕÖ¾
error_log
/data/log/nginx/nginx_error/nginx_error.log crit;
#
pid
pid
/var/run/nginx.pid;
#
Specifies
the value for maximum file descriptors t ......
³ÌÐò´úÂë
<!--p
if(isset($_POST['md5'])){ //ÅжÏ$md5ÊÇ·ñÒÑÉèÖã¬Èç¹ûÉèÖÃÁËÔòÖ´ÐÐÒÔÏ´úÂë¡£
if(!is_numeric($_POST['time'])){ //Èç¹ûû»ñÈ¡µ½timeµÄÖµÔò½«timeµÄÖµÉèÖÃΪ30
$_POST['time'] = 30;
}
set_time_limit($_P ......
ÏîÄ¿½á¹¹ÈçÉÏ
´´½¨counter.txtÎļþ
´´½¨counter1.phpÎļþ
³õʼ»¯counter.txtÎļþÖеÄÄÚÈÝ
ÊäÈë“0”
counter1.phpÎļþ´úÂë
<?php
$fp = fopen("counter.txt","r");
if ($str1==false){
$str1 = 0;
}
$str1 = fgets($fp,10);
$str1++;
fclose($fp);
$fp = ......
<?php
/*****************
Ãû³Æ£ºvalidator For PHP v1.0.0
ÈÕÆÚ£º2006-12-7
×÷ÕߣºÎ÷Â¥ÀäÔÂ
꿅᣼www.xilou.net | www.chinaCMS.org
ÃèÊö£ºÊý¾Ý¼ìÑéÀ࣬ÓÃÔÚ±íµ¥ÑéÖ¤ÉÏ
¹æÔò£ºÎÞ
*****************/
/*php×ÔÉíµÄ¼ì²âº¯Êý
*bool is_numeric ( mixed var)
*bool is_bool ( mixed var)
*bool is_null ( mixed ......