Concept
Can PHP array indices be non-contiguous?
ComputerScienceOne / Strings as Indices
"Another aspect of PHP associative arrays is that integer indices need not be contiguous. For example,\n\n1 $arr = array();\n\n2 $arr[0] = 10;\n\n3 $arr[5] = 20;\n\nThe values at indices 1 through 4 are undefined and the array contains some “holes” in its indices."
Related Ideas
- How can strings be used as indices in PHP arrays?ComputerScienceOne · Non-Contiguous Indices
- How can key-value pairs be initialized in a PHP array?ComputerScienceOne · Non-Contiguous Indices
- What PHP array concepts are listed in the index?ComputerScienceOne · Index
- How can you define arrays of strings in PHP?ComputerScienceOne · Arrays of Strings
- What is key-value initialization?ComputerScienceOne · Strings as Indices . . . . . . . . . . . . . . . . . . . . . . . . . . .