Home  >  Article  >  Backend Development  >  PHP中怎么定义变量

PHP中怎么定义变量

WBOY
WBOYOriginal
2016-06-13 11:45:121022browse

PHP中如何定义变量?
废话不多说 直接贴代码:

class DBUtil{
  private $dbname0 = '00000';

function test(){
  $dbname1 = '0000001';
  echo "

{$dbname1}

";
  //echo "

{$this->$dbname0}

";
}

}

?>

我调用test方法$dbname1 可以正常打印出来

但是解开下面的注释 无法打印 $dbname0 请问我哪个地方写错了 该怎么写?
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn