<<< Previous question <<< Question ID#0079.md >>> Next question >>>
What will be the output of the given PHP code?
$name = array("d" => "Mark", "a" => "David", "b" => "Peter", "c" => "Martha");
$nameArrayObject = new ArrayObject($name);
$nameArrayObject->ksort();
foreach ($nameArrayObject as $key => $val) {
echo "$key = $val\n";
}
- A) a = David b = Peter c = Martha d = Mark
- B) a = Mark b = David c = Peter d = Martha
- C) a = David b = Mark c = Martha d = Peter
- D) The script will throw an error message.
Answer
Answer: A