Question No : 8
Which of the following PHP statements will output Hello World on the screen?
i) echo (“Hello World”);
ii) print (“Hello World”);
iii) printf (“Hello World”);
iv) sprintf (“Hello World”);
i) and ii)
i), ii) and iii)
All of the mentioned
i), ii) and iv)
Question No : 9
What will be the output of the following PHP code ?
<?php $i = 2;
while (++$i){ while ($i --> 0) print $i;
} ?>
Question No : 10
What will be the output of the following PHP code ?
<?php $color1 = 1;
$color2 = 1;
echo $color1 + $color2;
?>
Question No : 11
What will be the output of the following code? If say date is 22/06/2013.
<?php echo Today is .date(F d, Y) ?>
Question No : 12
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));
?>
Array ( [0] => Array ( [1] => Volvo [2] => BMW ) [1] => Array ( [1] => Toyota [2] => Honda ) [2] => Array ( [1] => Mercedes [2] => Opel ) )
Array ( [1] => Array ( [1] => Volvo [2] => BMW ) [2] => Array ( [1] => Toyota [2] => Honda ) [3] => Array ( [1] => Mercedes [2] => Opel ) )
Array ( [0] => Array ( [0] => Volvo [1] => Volvo ) [1] => Array ( [0] => BMW [1] => BMW ) [2] => Array ( [0] => Toyota [1] => Toyota ) )
Array ( [0] => Array ( [0] => Volvo [1] => BMW ) [1] => Array ( [0] => Toyota [1] => Honda ) [2] => Array ( [0] => Mercedes [1] => Opel ) )
Question No : 13
What will be the output of the following PHP code ?
<?php $i = 0;
while(++$i || --$i){ print $i;
} ?>
Question No : 14
What will be the output of the following PHP code ?
<?php class myObject { }define('myObject::CONSTANT', 'test');
echo myObject::CONSTANT;
?>