¹ØÓÚphpÃæÏò¶ÔÏóµÄ¾²Ì¬±äÁ¿µÄÎÊÌâ
´úÂëÈçÏ£º
<?php
class Book{
static $num=0;
public function showme(){
echo 'ÄúÊǵÚ'.self::$num.'λ·Ã¿Í';
self::$num++;
}
}
$book1 = new Book();
$book1->showme();
echo"<br>";
$book2=new Book();
$book2->showme();
echo "<br>";
echo 'ÄúÊǵÚ'.Book::$num.'λ·Ã¿Í';
?>
½á¹ûÊÇ£º
ÄúÊǵÚ0λ·Ã¿Í
ÄúÊǵÚ1λ·Ã¿Í
ÄúÊǵÚ2λ·Ã¿Í
Èç¹û¸Äµôstatic ±ä³É public ÄÇôΪʲô»á³öÏÖ´íÎó£ºFatal error: Access to undeclared static property: Book::$num
ËäÈ»Book::$numÊǵ÷ÓõÄÀàÄÚ²¿±äÁ¿£¬¿ÉÊÇÈç¹ûÎÒÓÃÁËpublic²»ÊÇÄĶ¼ÄÜ·ÃÎʵĵ½Ã´£¿
ÄѵÀ Book::$num ±ØÐëÊǾ²Ì¬±äÁ¿£¿
Ôõô»ØÊ£¿
¾²Ì¬±äÁ¿²»ÓÃʵÀý»¯¶ÔÏ󣬵±ÀÛµÚÒ»´Î±»¼ÓÔØʱ¾ÍÒѾ·ÖÅäÁËÄÚ´æµ¥Ôª¡£
Õâ¾ä»°£¬Èç¹ûÊÊÓ¦µ½Õâ¸ö³ÌÐòµÄ»°£¬ÊDz»ÊÇclass Book{
static $num=0;
public function showme(){
echo 'ÄúÊǵÚ'.self::$num.'λ·Ã¿Í';
self::$num++;
}
}
ÕâʱÒѾ±»·ÖÅäÁËÄÚ´æÁËÄØ£¿
Ïà¹ØÎĵµ£º
Õâ¾ÍÒª´ÓË«ÒýºÅºÍµ¥ÒýºÅµÄ×÷Óý²Æð£º
Ë«ÒýºÅÀïÃæµÄ×ֶλᾹý±àÒëÆ÷½âÊÍÈ»ºóÔÙµ±×÷HTML´úÂëÊä³ö£¬µ«Êǵ¥ÒýºÅÀïÃæµÄ²»ÐèÒª½âÊÍ£¬Ö±½ÓÊä³ö¡£ÀýÈ磺
$abc='I love u';
echo $abc //½á¹ûÊÇ:I love u
echo '$abc' //½á¹ûÊ ......
¶¨ÒåºÍÓ÷¨
filter_var() º¯Êýͨ¹ýÖ¸¶¨µÄ¹ýÂËÆ÷¹ýÂ˱äÁ¿¡£
Èç¹û³É¹¦£¬Ôò·µ»ØÒѹýÂ˵ÄÊý¾Ý£¬Èç¹ûʧ°Ü£¬Ôò·µ»Ø false¡£
Óï·¨
filter_var(variable, filter, options)
²ÎÊýÃèÊö
variable
±ØÐè¡£¹æ¶¨Òª¹ýÂ˵ıäÁ¿¡£
filter
¿ÉÑ¡¡£¹æ¶¨ÒªÊ¹ÓõĹýÂËÆ÷µÄ ID¡£
options
¹æ¶¨°üº¬±êÖ¾/Ñ¡ÏîµÄÊý×é¡£¼ì²éÿ¸ö¹ýÂËÆ÷¿ÉÄܵı ......
Linux°²×°Mysql+Apach+PHP+phpMyAdmin
¡¡¡¡ÎÒµÄϵͳÊÇredhat as5 ½¨Òé´ó¼ÒÍêÈ«°²×°£¬ÒÔÃⰲװʱȱÉÙÏà¹ØµÄ±àÒëÆ÷µÈµÈ¡£
Ò»¡¢°²×°mysql£¨mysql-5.0.21.tar.gz£©
# tar zxf mysql-5.0.21.tar.gz
# cd mysql-5.0.21
#./configure --prefix=/usr/local/mysql --sysconfdir=/etc --lo ......
PHPÔ´´úÂë¼òµ¥·ÖÎö
1. Ŀ¼½á¹¹
1. build ºÍ±àÒëÓйصÄĿ¼¡£
2. ext À©Õ¹¿â´úÂ룬ÀýÈç Mysql¡¢zlib¡¢iconv µÈÎÒÃÇÊìϤµÄÀ©Õ¹¿â¡£
3. main Ö÷Ŀ¼¡£
4. sapi ºÍ¸÷ÖÖ·þÎñÆ÷µÄ½Ó¿Úµ÷Óã¬ÀýÈçapache¡¢IISµÈ£¬Ò²°üº¬Ò»°ãµÄfastcgi¡¢cgiµÈ¡£
5. wi ......