0
我想使用一個簡單的變量,在類中創建一個角色...但是,這不起作用。PHP類中的GLOBAL變量
$GLOBALS['world'] = "Isara";
class Character{
var $name;
var $status;
static $content;
function __construct($name){
$this->name=$name;
$this->getCharInfo();
}
private function getCharInfo(){
if(empty(self::$content)){
self::$content = file_get_contents("http://www.tibia.com/community/?subtopic=worlds&world=$GLOBALS['world']",0);