O:3:"Car":1:{s:4:"name";s:7:"new car";}
2014-12-11
a與b ==
a與b 不全等
$a
object(Car)#1 (1) {
["name"]=>
string(7) "new car"
}
$b
object(Car)#2 (1) {
["name"]=>
string(7) "new car"
}
$c
object(Car)#3 (1) {
["name"]=>
string(7) "new car"
}
a與b 不全等
$a
object(Car)#1 (1) {
["name"]=>
string(7) "new car"
}
$b
object(Car)#2 (1) {
["name"]=>
string(7) "new car"
}
$c
object(Car)#3 (1) {
["name"]=>
string(7) "new car"
}
2014-12-11
<?php
$subject = "my email is [email protected]";
//在這里補充代碼,實現正則匹配,并輸出郵箱地址
$p = '/\w+@\w+\.\w+/';//答案中的[\w\-],這個\-是什么意思?求教。
preg_match($p, $subject, $matches);
echo $matches[0];
?>
$subject = "my email is [email protected]";
//在這里補充代碼,實現正則匹配,并輸出郵箱地址
$p = '/\w+@\w+\.\w+/';//答案中的[\w\-],這個\-是什么意思?求教。
preg_match($p, $subject, $matches);
echo $matches[0];
?>
2014-12-11
<?php
//請修改變量p的正則表達式,使他能夠匹配str中的姓名
$p = '/name:([\w\s?]+)/';//私以為應該是這樣的
$str = "name:steven jobs";
preg_match($p, $str, $match);
echo $match[1]; //結果為:steven jobs
//請修改變量p的正則表達式,使他能夠匹配str中的姓名
$p = '/name:([\w\s?]+)/';//私以為應該是這樣的
$str = "name:steven jobs";
preg_match($p, $str, $match);
echo $match[1]; //結果為:steven jobs
2014-12-11
<?php
//請修改變量p的正則表達式,使他能夠匹配str中的姓名
$p = '/(\w+\s\w+)/';
$str = "name:steven jobs";
preg_match($p, $str, $match);
echo $match[1]; //結果為:steven jobs
//請修改變量p的正則表達式,使他能夠匹配str中的姓名
$p = '/(\w+\s\w+)/';
$str = "name:steven jobs";
preg_match($p, $str, $match);
echo $match[1]; //結果為:steven jobs
2014-12-11
class Truck extends Car {
public function speedUp()
{
$this->speed += 50;
parent::speedUp();
}
}這樣寫對了
public function speedUp()
{
$this->speed += 50;
parent::speedUp();
}
}這樣寫對了
2014-12-10
class Truck extends Car {
public function speedUp()
{
$this->speed += 50;
}
}
public function speedUp()
{
$this->speed += 50;
}
}
2014-12-10
默認都為public,外部可以訪問。一般通過->對象操作符來訪問對象的屬性或者方法,對于靜態屬性則使用::雙冒號進行訪問。當在類成員方法內部調用的時候,可以使用$this偽變量調用當前對象的屬性
2014-12-10