Home

What will be the output of the following PHP code?
 <?php  $cars = array(Volvo, BMW, Toyota, Honda, Mercedes, Opel);
print_r(array_chunk($cars, 2));
?>

A.

Array ( [0] => Array ( [1] => Volvo [2] => BMW ) [1] => Array ( [1] => Toyota [2] => Honda ) [2] => Array ( [1] => Mercedes [2] => Opel ) )

B.

Array ( [1] => Array ( [1] => Volvo [2] => BMW ) [2] => Array ( [1] => Toyota [2] => Honda ) [3] => Array ( [1] => Mercedes [2] => Opel ) )

C.

Array ( [0] => Array ( [0] => Volvo [1] => Volvo ) [1] => Array ( [0] => BMW [1] => BMW ) [2] => Array ( [0] => Toyota [1] => Toyota ) )

D.

Array ( [0] => Array ( [0] => Volvo [1] => BMW ) [1] => Array ( [0] => Toyota [1] => Honda ) [2] => Array ( [0] => Mercedes [1] => Opel ) )

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 = 5;while (--$i > 0 && ++$i){ print…
  2. What will be the output of the following PHP code? <?php $cars = array(Volvo, BMW, Toyota);echo I…
  3. Which directive determines how the session information will be stored?
  4. What will be the output of the following PHP code? <?php $a1 = array(red, green);$a2 = array(blue,…
  5. What will be the output of the following PHP code ? <?php class Constants{ define('MIN_VALUE', '0.0');define('MAX_VALUE',…
  6. What will be the output of the following code?<?php $foo = 'Bob'; $bar = &$foo; $bar…
  7. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = 1;echo $color1…
  8. What will be the output of the following PHP code? <?php $cars = array(Volvo, BMW, Toyota, Honda,…
  9. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = green;echo $color1.$color2;?>…
  10. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = red;echo $color1…
  11. What will be the output of the following PHP code ? <?php $i = 0;while (++$i && --$i){ print $i;}…
  12. What will be the output of the following PHP code ? <?php $i = 5;while (--$i > 0){ $i++;print $i;print…
  13. Which of the following is/are a PHP code editor?i) Notepadii) Notepad++iii) Adobe Dreamweaveriv) PDT
  14. What will be the output of the following PHP code? <?php $a = array(a=>red, b=>green, c=>blue);echo…
  15. What will be the output of the following PHP code ? <?php define(__LINE__, PHP is a scripting language);echo…
  16. Say you want to calculate the date 45 days from the present date which one of the following statement…
  17. What will be the output of the following PHP code? <?php $fname = array(Peter, Ben, Joe);$age = array(35,…
  18. PHP files have a default file extension of..
  19. What will be the output of the following PHP code ? <?php define(VAR_NAME,test);${VAR_NAME} = value;echo…
  20. What will be the output of the following PHP code ? <?php $i = 2;while (++$i){ while ($i --> 0) print…
  21. What will be the output of the following code? If say date is 22/06/2013. <?php echo Today is .date(F…
  22. What will be the output of the following PHP code? <?php $a1 = array(a=>red, b=>green, c=>blue, d=>yellow);$a2…
  23. What will be the output of the following PHP code ? <?php define(GREETING, PHP is a scripting language);echo…
  24. If the directive session.cookie_lifetime is set to 3600, the cookie will live until..
  25. What will be the output of the following PHP code ? <?php $i = 0;while(++$i || --$i){ print $i;}…
  26. What will be the output of the following PHP code ? <?php $i = 2;while (++$i){ while (--$i > 0) print…
  27. What will be the output of the following PHP code? <?php echo (checkdate(4,31,2010) ? 'Valid' : 'Invalid');?>…
  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 = ;while ($i = 10){ print hi;}print…
  30. What will be the output of the following PHP code ? <?php define('GOOD_OCTAL', 0700);define('BAD_OCTAL',…