84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
越努力越幸运!!!
What does the $ symbol mean in php? -PHP Chinese website Q&A-What does the $ symbol mean in php? -PHP Chinese website Q&A
Please watch and learn.
其实PHP采用的是C语言的语法,但是也有一些区别,$符号加上字符串,这就是一个变量名或对象名,例如下面的代码:class MyClass{ private $_val; public function foo(){ return $this->_val; } public function foo1(){ return $this->_val; } ......}$my = new MyClass;echo $my->foo();MyClass是个类名,不用加$符号,$_val是个私有变量,一般是以$加下划线加字符串组成的,foo和foo1是两个成员函数,不用加$符号,$my是一个对象,必须加$符号
php中$符号是变量符号;
把$符号加上字符串,这个字符串就是一个变量名或对象名。
What does the $ symbol mean in php? -PHP Chinese website Q&A-What does the $ symbol mean in php? -PHP Chinese website Q&A
Please watch and learn.
其实PHP采用的是C语言的语法,但是也有一些区别,$符号加上字符串,这就是一个变量名或对象名,例如下面的代码:
class MyClass{
private $_val;
public function foo(){
return $this->_val;
}
public function foo1(){
return $this->_val;
}
......
}
$my = new MyClass;
echo $my->foo();
MyClass是个类名,不用加$符号,$_val是个私有变量,一般是以$加下划线加字符串组成的,foo和foo1是两个成员函数,不用加$符号,$my是一个对象,必须加$符号
php中$符号是变量符号;
把$符号加上字符串,这个字符串就是一个变量名或对象名。