下標(biāo)可以訪問字符串中的元素: $str = "hello world"; $ch = $str[0]; // $ch 的值是 h 可以使用變量代替類名或函數(shù)名 class Animal { public function sayit() { echo "I am an animal"; } } function curiosity() { // 這兒很變態(tài) $class = "Animal"; $anm = new $class; $anm->sayit(); } 強大的timetostr函數(shù): echo date("Y-m-d H:i:s",strtotime("last Sunday")); # 真會會返回上周日的時間