" in php is the connector between the key name and the element in the array. To put it simply, use the "=>" symbol to separate the keys and values ​​in the array. The left side represents the key and the right side represents the value."/> " in php is the connector between the key name and the element in the array. To put it simply, use the "=>" symbol to separate the keys and values ​​in the array. The left side represents the key and the right side represents the value.">

Home >Backend Development >PHP Problem >What does => in php mean?

What does => in php mean?

尚
Original
2020-04-25 16:00:2010948browse

What does => in php mean?

=> in php is generally used as a connector between array keys and elements. Simply put, the => symbol is used to separate keys and values. The left side represents the key and the right side represents the value.

For example:

$arr = array(
'a'=>'123',
'b'=>'456'
);
foreach($arr as $key=>$val){
//$key是数组键名
//$val是数组键名对应的值
}

For more related tutorials, please pay attention to php Chinese website.

The above is the detailed content of What does => in php mean?. For more information, please follow other related articles on the PHP Chinese website!

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