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

PHP中怎么定义变量

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:45:12
Original
1068 people have browsed it

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

class DBUtil{
  private $dbname0 = '00000';

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

{$dbname1}

";
  //echo "

{$this->$dbname0}

";
}

}

?>

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

但是解开下面的注释 无法打印 $dbname0 请问我哪个地方写错了 该怎么写?
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template