Which of the following are true about arrays in PHP?

  • Arrays can only store values of the same data type.
  • Arrays can have both numeric and string keys.
  • Arrays cannot be nested within each other.
  • Arrays cannot be modified once they are created.
In PHP, arrays can have both numeric and string keys. This allows for flexibility in accessing and organizing data within the array. Arrays can store values of different data types, including strings, integers, floats, booleans, and even other arrays. Additionally, arrays can be modified by adding, updating, or removing elements. Nesting arrays within each other is also possible, leading to multidimensional arrays. Learn more: https://www.php.net/manual/en/language.types.array.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *