<?php class Foo { const BAR = 'bar'; public static function getConstantValue() { return self::BAR; } public function getConstant() { return self::BAR; } } $foo = 'Foo'; echo $foo::BAR, '<br />'; echo Foo::BAR, '<br />'; $obj = new Foo(); echo $obj->getConstant(), '<br />'; echo $obj->getConstantValue(), '<br />'; echo Foo::getConstantValue(); class Bar extends Foo { const BAR = 'foo'; public static function getMyConstant() { return self::BAR; } public static function getParentConstant() { return parent::BAR; } } echo Bar::getMyConstant(); // foo echo Bar::getParentConstant(); // bar
??? ??? ?? ????? ?? ??? ??? ??? ?? ????? ?? ??? ? ????
public, protected, private, static?? ??? ? ????
?? ???? (parent::? ?? ?? ???? ??? ???? ? ????. ) ?? ???? ??? ?????
PHP5.3.0?? ??? ???? ???? ???? ??? ? ????. ??? ? ??? ?? ???? ? ? ????
? ???? ?? ???? ???? ????? ?? ???? ????? ????????. ?????? ???? ?? ??????! ? ???? ?? ???? ?? ?????? ?????. ??? ???? ???? ??? ????. ??? ??? ?? ??? ?? ??? ???? ????! ??? ?? ?? ??? ???? ????? ????. ???: admin@php.cn
?? ??

28 Jul 2016
: PHP ?? PDO ?? ???? ?: ??? ?? ??????: <?php if(!definated("APP")){exit("?? ???? ???? ???? ????."); }????{ private static $pdo = null;/*** @?????? ?? ????* @return ??*/ ?? ?? ?? getConfig(){if($_SERVER[SERVER_

28 Jul 2016
PHP ?? ??: PHP ?? ?? PHP ?? ?? ?? ??: ? ????? PHP ?? ?? ??? ??? ?? ?????. ??? ?? ?? ??? ??????. ?? ??? ??? ????. 1. PHP? ???? ?? ?? ??? 2015-09-09? ???? ?????. $year = "2015";$month = "9";$day = "09";var_dump(checkdate($month,$day, $year)) ??? ??? ??? ??? ???. ;//?? 0? ?? ?? ?? ?? ?????.

29 Jul 2016
??? ?? ??? ?? ?? ?????: ??? ?? ??? ?? ?? ????? ??? ?? ????(1): ? ??? ?????? ???? ??? ??? ??: # ------ --- --------------------- # # ??? ??? ?? 'author' # CREATE TABLE ??? ( author_id int (6) DEFAULT '0' NOT NULL auto_increment, first_name varchar(20)

29 Jul 2016
??? ??: ??? ?? PHP ?? ?? ? ??: 1. ? ?? PHP??? list($a, $b) = $array? ?? ??? ?? ?? ????? list? ?????. ??? ?? ???? ?? ?? ?? ?? ??? ?? ?? NULL? ?????. list($a, ,$b) = $array? ?? ??? ???? ??? ?? ??? ?? ????. 2. ??? ???? ?? ??? ???? array_slice(array, offset, length);? ???? ???. ???? 0?? ???? ? ??? ?????. ?? ??? ??


??? ??

??? ?? ????? PHP ?????
??? ?? ????? PHP ?????

50?? ??? ??? PHP ???? ??
??? PHP ????, ??? ????? ??? ???? ?????

??? ???? ?? ?? PHP ?????
??? ???? ?? ?? PHP ?????
