Are PHP array keys case sensitive?

青灯夜游
Release: 2023-02-26 13:24:02
Original
3578 people have browsed it

An array is a special variable that can store multiple values in a single variable. PHP array, as the name suggests, is an array in PHP. Its characteristic is to map values to the type of keys. Unlike other languages, the keys of arrays in PHP can be strings, and the values can be of any type.

Are PHP array keys case sensitive?

In PHP, there are three types of arrays:

● Numeric array - an array with a numeric ID key

● Association Array - an array with specified keys, each key is associated with a value

● Multidimensional array - an array containing one or more arrays

Then PHP array keys are case-sensitive No?

Array index (key name) is case-sensitive

'first'); echo $arr['one']; //输出'first' echo $arr['One']; //无输出并报错 echo $Arr['one']; //上面讲过,变量名区分大小写,所以无输出并报错 ?
Copy after login

For more PHP related knowledge, please visitPHP Chinese website!

The above is the detailed content of Are PHP array keys case sensitive?. For more information, please follow other related articles on the PHP Chinese website!

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!