PHPÖеĶÔÏóÏà¶ÔÆäËüÓïÑÔ£¬±ÈÈçJava¡¢C#À´ËµÒª¼òµ¥ºÜ¶à¡£ËüûÓÐÖØÔØ£¨²»ÄÜ´æÔÚÏàͬµÄ·½·¨Ãû£©£¬¼Ì³ÐÒ²Ïà¶Ô¼òµ¥¡£
1.ÉùÃ÷Àà
ÀàµÄÉùÃ÷Ö÷Òª°üÀ¨Àà±¾ÉíµÄÉùÃ÷ÒÔ¼°·½·¨¡¢ÊôÐÔ¡¢¼Ì³Ð¡¢¹¹Ô캯ÊýµÄÉùÃ÷¡£ÕâЩ¶«Î÷˵ÆðÀ´Ò»¶Ñ£¬¿´´úÂë¾ÍºÜ¼òµ¥ÁË¡£¿´ÈçÏ´úÂë¡£
class Person { // ÉùÃ÷ÊôÐÔ var $name; // ¸øÊôÐÔÉèÖÃĬÈÏÖµ¡£Ä¬ÈÏÖµÖ»ÄÜÊǼòµ¥µÄ³£Á¿£¬²»ÄÜÓмÆËã¡£ var $age = 20; // ¹¹Ô캯Êý function Person($name, $age) { $this->name = $name; $this->age = $age; } } // ×ÓÀàµÄÉùÃ÷ class Employee extends Person { var $salary; // ¹¹Ô캯Êý function Employee($name, $age, $salary) { // µ÷Óø¸À๹Ô캯Êý $this->Person($name, $age); $this->salary = $salary; } // ·½·¨ÉùÃ÷ function add_salary($add) { $this->salary += $add; return $this->salary; } }2.´´½¨ºÍ·ÃÎʶÔÏó
ÔÚPHPÖУ¬¿ÉÒÔʹÓÃ$object = new Class;À´´´½¨¶ÔÏó¡£ÆäÖÐÀàÃû¿ÉÒÔÖ±½Óд£¬Ò²¿ÉÒÔÓñäÁ¿±íʾ¡£·ÃÎʶÔÏóÓÃ->¡£±ÈÈç·ÃÎÊÊô ÐÔ$object->propertyname,·ÃÎÊ·½·¨$object->mathodname();¿ÉÒÔ¿´ÈçÏ´úÂë¡£
// Ö±½ÓÓÃÀàÃû´´½¨¶ÔÏó $employ = new Employee('Dick', 20, 3000); // ÓñäÁ¿´´½¨¶ÔÏó $class_name = 'Employee'; $employ = new $class_name('Dick', 20, 3000); // ·ÃÎÊÊôÐÔ $name = $employ->name; // µ÷Ó÷½·¨ $added_salary = $employ->add_salary(1000);3.×ÔÊ¡
ÒòΪÔÚPHPÖУ¬×ÔÊ¡Óõ½µÄµØ·½²»ÊǺܶ࣬ËùÒԾͲ»Ïêϸ˵ÁË£¬Èç¹ûÏë¿´ÏêϸµÄ×ÊÁÏ£¬¿ÉÒÔ¿´¹Ù·½µÄ˵Ã÷¡£
class_exists() ²é¿´ÀàÊÇ·ñ´æÔÚ
get_ declared_ classes() ²é¿´ÒѾ¶¨ÒåµÄÀà
get_ parent_ class() È¡µÃ¸¸Àà
get_ class() È¡µÃ¶ÔÏóµÄÀàÃû
method_ exists() ¶ÔÏóÖÐÊÇ·ñ´æÔÚij¸öº¯Êý
property_ exists() ¶ÔÏóÖÐÊÇ·ñ´æÔÚij¸öÊôÐÔ
get_ class_ methods() È¡µÃÀඨÒåµÄº¯Êý
get_ class_ vars() È¡µÃÀඨÒåµÄÊôÐÔ
get_ object_ vars() È¡µÃ¶ÔÏóµÄÖµµÄÊý×é
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ