Home > Article > Backend Development > Are PHP array keys case sensitive?
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.
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
<?php $arr = array('one'=>'first'); echo $arr['one']; //输出'first' echo $arr['One']; //无输出并报错 echo $Arr['one']; //上面讲过,变量名区分大小写,所以无输出并报错 ?
For more PHP related knowledge, please visit PHP 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!