Explain how come the code <?php print contents: $arr[1]; ?> Works, but <?php print contents: $arr[1][2]; ?> Doesn't for two-dimensional array of mine?
Answer Posted / Gaurav Singhal
The code <code><?php print contents: $arr[1]; ?></code> works because $arr[1] accesses a single element of the one-dimensional array. However, the code <code><?php print contents: $arr[1][2]; ?></code> does not work since it attempts to access the third element ($arr[1][2]) of a two-dimensional array without initially defining the first and second dimensions.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers