Q. What will be the output of the following PHP code?
Code:<?php
function uppercase($string)
{
echo ucwords($string);
}
$wow = "uppercase";
$wow("Time to live king size");
?>
Dear candidates you will find MCQ questions of PHP here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
<?php
function uppercase($string)
{
echo ucwords($string);
}
$wow = "uppercase";
$wow("Time to live king size");
?>
<?php
function calc($num1, $num2)
{
$total = $num1 * $num2;
}
$result = calc(42, 0);
echo $result;
?>
<?php
function constant()
{
define("GREETING", "Welcome to Narnia",true);
echo greeting;
}
?>
<?php
echo str_pad("Salad", 5)." is good.";
?>
<?php
function colour()
{
$colors = array("red", "green", "blue", "yellow");
foreach ($colors as $value)
{
echo "$value <br>";
}
}
colour();
?>
<?php
function 2myfunc()
{
echo "Hello World";
}
2myfunc();
?>
<?php
function foo($msg)
{
echo "$msg";
}
$var1 = "foo";
$var1("will this work");
?>
<?php
$user = array("Ashley", "Bale", "Shrek", "Blank");
for ($x=0; $x < count($user) - 1; $x++)
{
if ($user[$x++] == "Shrek")
continue;
printf ($user[$x]);
}
?>