To declare an associative array in PHP, you can use the array() function or the [] shorthand, and the keys are assigned ______.

  • Sequentially starting from 0
  • Alphabetically based on the element's value
  • Based on the position of the element
  • Explicitly by the programmer
To declare an associative array in PHP, you can use the array() function or the [] shorthand. When declaring an associative array, the keys are assigned explicitly by the programmer. Each key-value pair is defined within the array using the desired key and its corresponding value. The programmer has control over assigning meaningful keys to associate specific values. This allows for customized data organization and retrieval. Learn more: https://www.php.net/manual/en/language.types.array.php#language.types.array.syntax
Add your answer
Loading...

Leave a comment

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