CSE :: PHP - CS
-
What will be the output of the following PHP code?
<?php
define("GREETING","Hello you! How are you today?");
echo constant("GREETING");
?>
-
What will be the output of the following PHP code?
<?php
function sum($num1, $num2)
{
$total = $num1 + $num2;
echo "chr($total)";
}
$var1 = "sum";
$var1(5, 44);
?>
-
What will be the output of the following PHP code?
<?php
function sum($num1, $num2)
{
$total = $num1 + $num2;
echo "cos($total)";
}
sum(5,-5);
?>
-
What will be the output of the following PHP code?
<?php
function b()
{
echo "b is executed";
}
function a()
{
b();
echo "a is executed";
b();
}
a();
?>
-
What will be the output of the following PHP code?
<?php
function addFunction($num1, $num2)
{
$sum = $num1 + $num2;
return $sum;
}
$return_value = addFunction(10, 20);
echo "Returned value from the function : $return_value"
?>
-
What will be the output of the following PHP code?
<?php
function sayHello()
{
echo "HelloWorld<br />";
}
$function_holder = "sayHello";
$function_holder();
?>
-
What will be the output of the following PHP code?
span>
function one()
{
echo " this works";
function two()
{
echo "this too works";
}
}
one();
two();
?>
-
What will be the output of the following PHP code?
<?php
function do($myString)
{
echo strpos($myString, "donkey",0);
}
do("The donkey looks like a horse.");
?>
-
What will be the output of the following PHP code?
<?php
function onespan>()
{
define("const","I am awesome!");
echo constant("const");
}
one();
?>
-
What will be the output of the following PHP code?
<?php
$title = "O'malley wins the heavyweight championship!";
echo ucwords($title);
?>