Home

What will be the output of the following PHP code?
 <?php  $a1 = array(a=>red, b=>green, c=>blue, d=>yellow);
$a2 = array(e=>red, f=>green, g=>blue);
$result = array_diff($a1, $a2);
print_r($result);
?>

A.

Array ( [d] => yellow )

B.

Array ( [c] => blue )

C.

Array ( [a] => red )

D.

Array ( [e] => yellow )

Please do not use chat terms. Example: avoid using "grt" instead of "great".

You can do it
  1. What will be the output of the following PHP code ? <?php $i = 0;while ((--$i > ++$i) - 1){ print…
  2. To create an object and set the date to JUNE 22, 2013, which one of the following statement should be…
  3. Which one of the following is the very first task executed by a session enabled page?
  4. What will be the output of the following PHP code ? <?php $color = red;$color = green;echo $color;?>…
  5. What will be the output of the following PHP code ? <?php $i = 5;while (--$i > 0){ $i++;print $i;print…
  6. What will be the output of the following PHP code ? <?php define(VAR_NAME,test);${VAR_NAME} = value;echo…
  7. What will be the output of the following PHP code? <?php $a = array(A, Cat, Dog, A, Dog);print_r(array_count_values($a));?>…
  8. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = 1;$color3 = greyecho…
  9. What is the default number of seconds that cached session pages are made available before the new pages…
  10. If the directive session.cookie_lifetime is set to 3600, the cookie will live until..
  11. What will be the output of the following PHP code? <?php $a = array(red, green, blue);array_pop($a);print_r($a);?>…
  12. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = green;echo $color1…
  13. Which of the following PHP statements will output Hello World on the screen?i) echo (“Hello World”);ii)…
  14. What will be the output of the following PHP code ? <?php class Constants{ define('MIN_VALUE', '0.0');define('MAX_VALUE',…
  15. What will be the output of the following PHP code ? <?php $i = 5;while (--$i > 0 && ++$i){ print…
  16. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = green;echo $color1.$color2;?>…
  17. What will be the output of the following PHP code ? <?php define(NEW_GOOD_NAME_CONSTANT, I have a…
  18. Which of the following must be installed on your computer so as to run PHP script?i) Adobe Dreamweaverii)…
  19. What will be the output of the following PHP code? If say date is 22/06/2013. <?php printf( date(t)…
  20. What will be the output of the following PHP code ? <?php $color = red;echo $color . red ;?>
  21. Which one of the following function is useful for producing a timestamp based on a given date and time.
  22. What will be the output of the following PHP code? <?php $age = array(Peter=>35, Ben=>37, Joe=>43);print_r(array_change_key_case($age,…
  23. What will be the output of the following PHP code ? <?php $i = 2;while (++$i){ while (--$i > 0) print…
  24. If the format is F then which one of the following will be returned?
  25. What will be the output of the following PHP code ? <?php define('GOOD_OCTAL', 0700);define('BAD_OCTAL',…
  26. What will be the output of the following PHP code? <?php $cars = array(Volvo, BMW, Toyota, Honda,…
  27. What will be the output of the following code? If say date is 22/06/2013. <?php echo Today is .date(F…
  28. What will be the output of the following PHP code ? <?php $i = 5;while (--$i > 0 || ++$i){ print…
  29. What will be the output of the following PHP code ? <?php $i = 2;while (++$i){ while ($i --> 0) print…
  30. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = red;echo $color1…