PHP:对象的回显变量名称?
|
我想回显我正在调用的变量对象的名称,在这种情况下为controller_01。
我正在使用get_class,但不会打印变量名称,仅显示对象类型:(
<?php
class remoteControl{
private $chip = \"Intel64<br />\";
public function openCase(){
echo \"The controler has a \" .get_class($this);
return $this->chip;
}
}
$control_01 = new remoteControl();
echo $control_01-> openCase();
?>
没有找到相关结果
已邀请:
1 个回复
貉骂