This article mainly introduces the php array key name tips, analyzes common php array key name usage tips, and has some reference value, for more information about php array key names, see the following section. Share it with you for your reference. The specific analysis is as follows:
1. $ arr [true] is equivalent to $ arr [1]; $ arr [false] is equivalent to $ arr [0].
2. using null as the key name is equivalent to creating or overwriting a $ arr [null]. you can use $ arr [null] or $ arr [""] for access.
3. when a number with a decimal point is used as the key name, the key name will automatically take the integer part as the key name. For example, if $ arr [123.45] = 5, you can use $ arr [123.45] or $ arr [123] to obtain the key value. use foreach to repeat the time, $ arr [123] is used.
4. $ arr [] = 5. this element is added to the array $ arr.
Note: The data type of the middle-key in the array is integer or string.
I hope this article will help you with php programming.