Home

What will be the output of the following PHP code?
 <?php  $a1 = array(red, green);
$a2 = array(blue, yellow);
print_r(array_merge($a1, $a2));
?>

A.

Array ( [0] => red [1] => green)

B.

Array ( [0] => blue [1] => yellow [2] => red [3] => green )

C.

Array ( [0] => red [1] => green [2] => blue [3] => yellow )

D.

Array ( [0] => blue [1] => 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 $color1 = red;$color2 = green;echo $color1.$color2;?>…
  2. How many ways can a session data be stored?
  3. What will be the output of the following PHP code? <?php $a1 = array(a=>red, b=>green, c=>blue, d=>yellow);$a2…
  4. Which one of the following is the default PHP session name?
  5. What does PHP stand for?i) Personal Home Pageii) Hypertext Preprocessoriii) Pretext Hypertext Processoriv)…
  6. What will be the output of the following PHP code? <?php $a1 = array_fill(3, 4, blue);$b1 = array_fill(0,…
  7. What will be the output of the following PHP code ? <?php $i = 5;while (--$i > 0 && ++$i){ print…
  8. Which directive determines how the session information will be stored?
  9. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = 1;$color3 = greyecho…
  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 $i = 2;while (++$i){ while ($i --> 0) print…
  12. What will be the output of the following PHP code ? <?php define(GREETING, PHP is a scripting language,…
  13. Which of the following must be installed on your computer so as to run PHP script?i) Adobe Dreamweaverii)…
  14. What will be the output of the following PHP code? <?php $a1 = array(red, green);$a2 = array(blue,…
  15. What will be the output of the following PHP code ? <?php $i = 0;while(++$i || --$i){ print $i;}…
  16. What will be the output of the following PHP code? <?php $fname = array(Peter, Ben, Joe);$age = array(35,…
  17. What will be the output of the following PHP code ? <?php /*echo Hello world;*/ ?>
  18. What will be the output of the following PHP code ? <?php $i = 0;while (++$i && --$i){ print $i;}…
  19. What will be the output of the following PHP code ? <?php $color1 = 1;$color2 = 1;echo $color1 +…
  20. What will be the output of the following PHP code ? <?php define(VAR_NAME,test);${VAR_NAME} = value;echo…
  21. What will be the output of the following PHP code? <?php $a = array(red, green, blue);array_pop($a);print_r($a);?>…
  22. What will be the output of the following PHP code ? <?php $i = 5;while (--$i > 0 || ++$i){ print…
  23. A PHP script should start with ___ and end with ___:
  24. What will be the output of the following PHP code ? <?php $i = 0;while ($i = 10){ print hi;}print…
  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? If say date is 22/06/2013. <?php printf( date(t)…
  27. What will be the output of the following PHP code ? <?php define('IF', 42);echo IF: , IF;?>
  28. Say you want to calculate the date 45 days from the present date which one of the following statement…
  29. What will be the output of the following PHP code ? <?php class myObject { }define('myObject::CONSTANT',…
  30. What is the default time(in seconds) for which session data is considered valid?