Q:

What will be the output of the following PHP code ?

0

What will be the output of the following PHP code ?

<?php
$age = array("Harry" => "21", "Ron" => "19", "Malfoy" => "23");
ksort($age);
foreach($age as $x => $x_value)
{
    echo "Key=" . $x . ", Value=" . $x_value;
    echo "<br>";
}
?>

  1. Key = Harry, Value = 21 Key = Ron, Value = 21 Key = Malfoy, Value = 23
  2. Key = Harry, Value = 21 Key = Ron, Value = 19 Key = Malfoy, Value = 23
  3. Key = Harry, Value = 21
    Key = Malfoy, Value = 23
    Key = Ron, Value = 19
  4. Key = Ron, Value = 19 Key = Harry, Value = 21 Key = Malfoy, Value = 23

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

 (c).Key = Harry, Value = 21
Key = Malfoy, Value = 23
Key = Ron, Value = 19

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now