我想在我的類中的函數中將全局變量轉換爲$ this->變量。這可能嗎?這是我爲班上的代碼。
class tool
{
//If this is used remember to replace Void with $target
public function mute()
{
global $target;
mysql_query("UPDATE users SET mute='1' WHERE name='". $target ."'");
}
}
看到看代碼示例:http://3v4l.org/p7oH4 – floww