我可以在类之外更改在类中定义的函数或变量,但不使用全局变量吗?PHP - 从类之外更改类变量/函数
这是类,里面包含文件#2:
class moo{
function whatever(){
$somestuff = "....";
return $somestuff; // <- is it possible to change this from "include file #1"
}
}
在主应用程序
,这是怎样的类用于:
include "file1.php";
include "file2.php"; // <- this is where the class above is defined
$what = $moo::whatever()
...
你是什么意思的“包含文件#1”? – Gordon 2011-02-10 09:27:28