首页上一页 1 下一页尾页 1 条记录 1/1页
面向对象
发表在PHP图书答疑
2015-04-11
是否精华
是
否
版块置顶:
是
否
<?php
class sportobject
{
public $name;
public $height;
public $weight;
public function football($name,$heigth,$weigth)
{
$this->name=$name;
$this->height=$height;
$this->weight=$weight;
if($this->height<185 and $this->weight<85)
{
return $this->name.",符合条件";
}
else
{
return $this->name.",不符合条件";
}
}
}
$sport=new sportobject();
echo $sport->fooball('明日','178','77');
?>
显示错误 “Call to undefined method sportobject::fooball() in F:\AppServ\www\mm\04\chengyuan.php on line 24”
class sportobject
{
public $name;
public $height;
public $weight;
public function football($name,$heigth,$weigth)
{
$this->name=$name;
$this->height=$height;
$this->weight=$weight;
if($this->height<185 and $this->weight<85)
{
return $this->name.",符合条件";
}
else
{
return $this->name.",不符合条件";
}
}
}
$sport=new sportobject();
echo $sport->fooball('明日','178','77');
?>
显示错误 “Call to undefined method sportobject::fooball() in F:\AppServ\www\mm\04\chengyuan.php on line 24”