setcookie('test',"",time()-1);
第二个参数是cookie的值value,第三个参数才是过期时间!
第二个参数是cookie的值value,第三个参数才是过期时间!
2016-10-20
//备注:访问php类中的成员变量或方法时,如果是定义常量或者静态变量用self:: 反之则用$this->
2016-10-20
//定义继承于Car的Truck类
class Truck extends Car{
public function speedUp(){
$this->speed +=60;
return $this->speed;
}
}
class Truck extends Car{
public function speedUp(){
$this->speed +=60;
return $this->speed;
}
}
2016-10-20
<?php
class Car {
public $speed = 0;
//增加speedUp方法,使speed加10
public function speedUp(){
$this->speed = $this->speed + 10;
}
}
$car = new Car();
$car->speedUp();
echo $car->speed;
class Car {
public $speed = 0;
//增加speedUp方法,使speed加10
public function speedUp(){
$this->speed = $this->speed + 10;
}
}
$car = new Car();
$car->speedUp();
echo $car->speed;
2016-10-19
<?php
class Car{
//在这里定义一个共有属性name
var $name="汽车";
}
$car = new Car();
//在这里输出$car对象的name属性
echo $car ->name;
class Car{
//在这里定义一个共有属性name
var $name="汽车";
}
$car = new Car();
//在这里输出$car对象的name属性
echo $car ->name;
2016-10-19