A

Admin • 833.24K Points
Coach

Q. Which of the following is a correct way to create an associative array?

  • (A) $arr = ['name' => 'John', 'age' => 25];
  • (B) $arr = {name: 'John', age: 25};
  • (C) $arr = ('name' => 'John', 'age' => 25);
  • (D) $arr = array('John', 25);
  • Correct Answer - Option(A)
  • Views: 26
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin

Associative arrays use key => value pairs.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.