A
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");
?>
Here, you will find a collection of MCQ questions on PHP. Go through these questions to enhance your preparation for upcoming examinations and interviews.
To check the correct answer, simply click the View Answer button provided for each question.
Have your own questions to contribute? Click the button below to share your MCQs with others!
+ Add QuestionA
<?php
function uppercase($string)
{
echo ucwords($string);
}
$wow = "uppercase";
$wow("Time to live king size");
?>
A
<?php
function calc($num1, $num2)
{
$total = $num1 * $num2;
}
$result = calc(42, 0);
echo $result;
?>
A
<?php
function constant()
{
define("GREETING", "Welcome to Narnia",true);
echo greeting;
}
?>
A
<?php
echo str_pad("Salad", 5)." is good.";
?>
A
<?php
function colour()
{
$colors = array("red", "green", "blue", "yellow");
foreach ($colors as $value)
{
echo "$value <br>";
}
}
colour();
?>
A
<?php
function 2myfunc()
{
echo "Hello World";
}
2myfunc();
?>
A
<?php
function foo($msg)
{
echo "$msg";
}
$var1 = "foo";
$var1("will this work");
?>
A
<?php
$user = array("Ashley", "Bale", "Shrek", "Blank");
for ($x=0; $x < count($user) - 1; $x++)
{
if ($user[$x++] == "Shrek")
continue;
printf ($user[$x]);
}
?>
A
A
If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.
Share Your MCQ