"map.php"和$this->$name = $value里的=> ,->分别有什么不同"/> "map.php"和$this->$name = $value里的=> ,->分别有什么不同">
Home > Backend Development > PHP Tutorial > "site map"=>"map.php"和$this->$name = $value里的=> ,->分别有什么不同

"site map"=>"map.php"和$this->$name = $value里的=> ,->分别有什么不同

WBOY
Release: 2016-06-23 13:58:46
Original
589 people have browsed it

"site map"=>"map.php"和$this->$name = $value里的=> ,->分别有什么不同


回复讨论(解决方案)

=> 是数组成员访问符号

-> 是对象成员访问符号

比如:

$array = array("site map"=>"map.php"); //定义了一个数组,包含一个数组成员:键名为site map,值为map.php

$this->$name = $value

$this 在php语言里是个特定的变量,它代表了类本身,->是访问其类成员的操作符,$this->$name = $value,这句代码意思是:将当前类的name变量的值设置为 $value.

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