A

Admin • 828.03K Points
Coach

Q. How do you create an associative array in PHP?

  • (A) $arr = array('key' => 'value');
  • (B) $arr = ['key' => 'value'];
  • (C) Both 1 and 2
  • (D) $arr = associative('key', 'value');
  • Correct Answer - Option(C)
  • Views: 8
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin
PHP allows associative arrays using both array() and [] syntax.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.