【发布时间】:2014-02-24 10:00:41
【问题描述】:
我是php新手,所以请原谅我缺乏知识。我正在使用 eclipse 并且在项目中有一个包含 3 个文件的项目。我正在创建一个查找折扣类,它采用类对象从另一个类调用函数。错误:
注意:未定义的变量:GetInfoClass 行.. 致命错误:在非对象行上调用成员函数 getAge() ...
我试图阅读它,但我似乎无法理解它。请帮忙。谢谢
表单响应:
include "GetInfo.php";
include "IfDiscount.php";
$IfDiscount= new IfDiscount();
echo $IfDiscount->findDiscount();
类 IfDiscount:
class IfDiscount
{
public function findDiscount(){
$Age = $GetInfoClass->getAge();
echo $Age;}}
【问题讨论】:
标签: php function class object globals