Home
Subscribe TechModgy to learn about new technologies!

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 ) )

0) print $i;} ?> ">What will be the output of the following PHP code ? <?php $i = 2;while (++$i){ while ($i --> 0) print…
  • If the format is F then which one of the following will be returned?
  • What will be the output of the following PHP code ? <?php $color1 = red;$color2 = green;echo $color1.$color2;?>…
  • What will be the output of the following PHP code ? <?php $color = red;$color = green;echo $color;?>…
  • What will be the output of the following PHP code? <?php $a1 = array(red, green);$a2 = array(blue,…
  • What will be the output of the following PHP code ? <?php define(GREETING, PHP is a scripting language);echo…
  • What will be the output of the following PHP code? <?php $cars = array(Volvo, BMW, Toyota, Honda,…
  • What will be the output of the following PHP code ? <?php define(__LINE__, PHP is a scripting language);echo…
  • What will be the output of the following PHP code ? <?php $i = 0;while ($i = 10){ print hi;}print…
  • Which one of the following function is useful for producing a timestamp based on a given date and time.
  • What does PHP stand for?i) Personal Home Pageii) Hypertext Preprocessoriii) Pretext Hypertext Processoriv)…
  • What will be the output of the following PHP code ? <?php define(VAR_NAME,test);${VAR_NAME} = value;echo…
  • What will be the output of the following PHP code ? <?php $i = 0;while ((--$i > ++$i) - 1){ print…
  • If session.use_cookie is set to 0, this results in use of..
  • What will be the output of the following PHP code ? <?php $i = 0;while (++$i && --$i){ print $i;}…
  • Which directive determines how the session information will be stored?
  • What will be the output of the following PHP code ? <?php $color = red;echo $color . red ;?>
  • What will be the output of the following PHP code ? <?php class myObject { }define('myObject::CONSTANT',…
  • Which of the following is/are a PHP code editor?i) Notepadii) Notepad++iii) Adobe Dreamweaveriv) PDT
  • What will be the output of the following PHP code ? <?php $color1 = red;$color2 = 1;$color3 = greyecho…
  • If the directive session.cookie_lifetime is set to 3600, the cookie will live until..
  • Which of following variables can be assigned a value to it?i) $3helloii) $_helloiii) $thisiv) $This
  • The date() function returns ___ representation of the current date and/or time.
  • What will be the output of the following PHP code ? <?php $i = 5;while (--$i > 0 || ++$i){ print…
  • What will be the output of the following PHP code? <?php $a = array(A, Cat, Dog, A, Dog);print_r(array_count_values($a));?>…
  • -->

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