Xel*_*a C 10 php oop this keyword
可能重复:
PHP:self vs this
您好,能帮我理解PHP变量名的含义$this吗?
谢谢您的帮助.
jod*_*odm 16
$this 是指你所在的班级.
例如
Class Car {
function test() {
return "Test function called";
}
function another_test() {
echo $this->test(); // This will echo "Test function called";
}
}
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助.