Concept

How are elements added to the next available integer index in a PHP array?

ComputerScienceOne / Removing Elements

"By using the assignment operator but not specifying the index, the element will be added to the next available integer index. Since there were already 3 elements in the array, each subsequent element is inserted at index 3, 4, and 5 respectively. In general, the element will be inserted at the maximum index value already used plus one.\n\n$arr = array(10, 20, 30);\n\n$arr[] = 5;\n\n$arr[] = 15;\n\n$arr[] = 25;\n\nprint_r($arr);\n\nThe example above results in the following.\n\nArray ( [0] => 10 [1] => 20 [2] => 30 [3] => 5 [4] => 15 [5] => 25 )"

Related Ideas

How are elements added to the next available integer index in a PHP array? | ComputerScienceOne | Bifalgorithm | Bifalgorithm