Which is the correct example of an Associative array in PHP?

111. Which is the correct example of an Associative array in PHP?

  1. $person = array("Alvin"=>"Delhi", "Alex"=>"Mumbai", "Bhavik"=>"Banglore");
  2. $person = array("Alvin"=>"Delhi"; "Alex"=>"Mumbai"; "Bhavik"=>"Banglore");
  3. $person = new array("Alvin"=>"Delhi", "Alex"=>"Mumbai", "Bhavik"=>"Banglore");
  4. $person = new array("Alvin"=>"Delhi"; "Alex"=>"Mumbai"; "Bhavik"=>"Banglore");

Answer: A) $person = array("Alvin"=>"Delhi", "Alex"=>"Mumbai", "Bhavik"=>"Banglore");

Explanation:

The valid example of an Associative array in PHP is:

$person = array("Alvin"=>"Delhi", "Alex"=>"Mumbai", "Bhavik"=>"Banglore");

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.