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
?>
Ïà¹ØÎĵµ£º
array getimagesize(string filename)
¸Ãº¯Êý·µ»ØÒ»¸öËÄÎÞËØµÄ¾ØÕ󡢸æËßÄãËù¸øÎļþÃûµÄͼÏñ³ß
´ç¡£¸ÃÎļþµÄ¸ñʽ±ØÐëÊÇGIF,jpeg»òPNGÖеÄÈÎÒ»ÖÖ¡£
Ôª
ËØ
ÃèÊö
0
¿í¶ÈµÄÏñËØÊý
1
¸ß
¶ÈµÄÏñËØÊý
2
ͼÏñµÄÀàÐÍ£¨GIF=1,JPG=2,PNG=3)
3
ÔÚ
IMG±ê¼ÇÖпÉÓõ ......
1:·ÅÁË6¸öÎļþÔÚcÅÌÏÂ(php5ts.dll,libmysql.dll ,php_gd2.dll,php_mysql.dll,php_mbstring.dll ),Ò»¸öÔÚwindowsÏÂ,ÁíÎå¸öÔÚwindows/system32ÏÂ
2:ÅäÖÃÁËpath
3:ÃüÁî:httpd.exe -w -n "Apache2" -k start À´²é¿´ÊÇÄÄÒ»ÐеĴíÎóÐÅÏ¢.
×ܽá:µ½ÏÖÔÚΪֹ,ÕûÁËÒ»Ìì,×°ÁËÈý´ÎϵͳµÄÂé·³ÖÕÓÚÇ×ÉíÖ¤Ã÷ÁË,
Õâ¸ö×ï¿ý»öÊײúÉúµÄÔÒò ......
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 ......
PHPÖÐÌṩËĸöº¯ÊýʵÏÖ¶Ôphp.iniµÄ²Ù×÷£ºini_get¡¢ini_set¡¢ini_get_all¡¢ini_restore
ÆäÖÐ×î³£ÓõÄÊÇini_setºÍini_get¡£
ÏÂÃæ¾ßÌåÀ´ËµËµÕâÁ½¸öº¯ÊýµÄ×÷Óãº
ini_get()
»ñÈ¡ÅäÖÃÎļþµÄÑ¡ÏîÖµ£¬¼´»ñÈ¡ÅäÖÃÎļþÖÐijһ¸öÑ¡ÏîµÄÖµ£¬Èç¹ûÊÇtrueÖµ¾Í·µ»Ø1£¬Èç¹ûÊÇfalseÖµ¾Í·µ»Ø0£¬×Ö·û´®¾Í·µ»Ø×Ö·û´®¡£
ÀýÈ磺
<?p ......