phpÖÐµÄ Àà³£Á¿ Class Constants
It is possible to define constant values on a per-class basis remaining the same and unchangeable.
Constants differ from normal variables in that you don't use the $ symbol to declare or use them. Like static members, constant values cannot be accessed from an instance of the object (using $object::constant).
˵Ã÷£º const ³£Á¿ ²»Óà $ ·ûºÅ
const ²»¼Ó¹Ø¼ü×Ö private ÐÞÊÎ //Like static members,
²»ÄÜͨ¹ý ¶ÔÏó·ÃÎÊ¡£ Ö»ÄÜͨ¹ýclass·ÃÎÊ
Àý×Ó 19-15. Defining and using a constant
<?php
class MyClass
{
const constant = 'constant value';
function showConstant() {
echo self::constant . "\n";
}
}
echo MyClass::constant . "\n";
$class = new MyClass();
$class->showConstant();
// echo $class::constant; is not allowed
?>
Ïà¹ØÎĵµ£º
ħÊõÒýºÅ£¨Magic Quote£©ÊÇÒ»¸ö×Ô¶¯½«½øÈë PHP ½Å±¾µÄÊý¾Ý½øÐÐתÒåµÄ¹ý³Ì¡£×îºÃÔÚ±àÂëʱ²»Òª×ªÒå¶øÔÚÔËÐÐʱ¸ù¾ÝÐèÒª¶ø×ªÒå
ʲôÊÇħÊõÒýºÅ
µ±´ò¿ªÊ±£¬ËùÓÐµÄ '£¨µ¥ÒýºÅ£©£¬"£¨Ë«ÒýºÅ£©£¬\£¨·´Ð±Ïߣ©ºÍ NULL ×Ö·û¶¼»á±»×Ô¶¯¼ÓÉÏÒ»¸ö·´Ð±Ïß½øÐÐתÒå¡£ÕâºÍ addslashes() ×÷ÓÃÍêÈ«Ïàͬ¡£
Ò»¹²ÓÐÈý¸öħÊõÒýºÅÖ¸Á
&nb ......
ת×Ô£ºÒÁÍ¼Íø[www.4ico.com]ÔÚ²ûÊöÀàµÄ¸ÅÄî֮ǰÎÒÃÇÀ´ÏÈËµËµÃæÏò¶ÔÏó±à³ÌµÄ¸ÅÄî£ºÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼Æ(Object-Oriented Programming£¬¼ò¼ÇΪOOP)Á¢ÒâÓÚ´´½¨Èí¼þÖØÓôúÂ룬¾ß±¸¸üºÃµØÄ£ÄâÏÖʵÊÀ½ç»·¾³µÄÄÜÁ¦£¬ÕâʹËü±»¹«ÈÏΪÊÇ×ÔÉ϶øÏ±à³ÌµÄÓÅʤÕß¡£Ëüͨ¹ý¸ø³ÌÐòÖмÓÈëÀ©Õ¹Óï¾ä£¬°Ñº¯Êý“·â×°”½ø±à³ÌËù±ØÐèµÄ&l ......
PHP100·ÖÒ³´úÂëÐ޸İ棬ËãαԴ´°É
ÏÂÃæÊDzâÊԵĹý³Ì:
Îļþpage.php,´úÂëÈçÏÂ:
<?php
/*
* author£ºphp100.com ÂÛ̳ nicholas_ng
*/
function page($page,$total,$phpfile,$pagesize=3,$pagelen=3){
$pagecode = '';//¶¨Òå±äÁ¿£¬´æ·Å·ÖÒ³Éú³ÉµÄHTML
$page = intval($page);//±ÜÃâ·ÇÊý×ÖÒ³Âë
$total = intval($ ......
apache_2.2.8+ mysql_5.1.41+ php-5.2.12+ phpMyAdmin-3.2.5
1,°²×°apacheĬÈϰ²×°¼´¿É
2,°ÑÏÂÔØµÄphp5.2.12½âѹ°Ñ½âѹÎļþ¼ÐµÄËùÓÐÎļþ¸´ÖƵ½DÅÌPHPÎļþ¼ÐÖÐ:
3,´ò¿ªPHPÎļþ¼ÐÖаÑphp.ini-dist¸ÄΪphp.ini²¢´ò¿ª²¢°Ñ
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mhash.dll
extension=php_mime ......
http://www.phpli.com/tuto/viewarticle.php?columns=tutorial&id=493
Ò»¡¢¿ª·¢³ÉÔ±
a)ÏîÄ¿Ö÷¹Ü
b)Ò³ÃæÃÀ¹¤
c)Ò³Ãæ¿ª·¢
d)·þÎñ¶Ë³ÌÐò¿ª·¢
e)ϵͳÓëÊý¾Ý¹ÜÀí
f)²âÊÔÓë°æ±¾¿ØÖÆ
¶þ¡¢ ÍøÕ¾×鿪·¢¼òÃ÷Á÷³Ì
Èý¡¢ ¿ª·¢¹¤¾ßÓë»·¾³
a)·þÎñÆ÷ÅäÖÃ
i. WEB·þÎñÆ÷£º FreeBSD6.1+Apache2.0+PHP5.0£¬SVN°æ±¾¿ØÖÆ·þÎñ(½ö²âÊ ......