CSE :: PHP - CS
-
What will be the output of the following PHP code ?
<?php
function _func()
{
echo "Hello World";
}
_func();
?>
-
What will be the output of the following PHP code ?
<?php
function test($int)
{
if ($int == 1)
echo "This Works";
if ($int == 2)
echo "This Too Seems To Work";
}
test(1);
TEST(2);
?>
-
What will be the output of the following PHP code ?
<?php
function mine($num)
{
$num = 2 + $num;
echo $num;
}
mine(3);
?>
-
What will be the output of the following PHP code ?
<?php
function mine($num)
{
$num = 2 + $num;
echo "$num";
}
mine(3);
?>
-
What will be the output of the following PHP code ?
<?php
function movie($int)
{
$movies = array("Fight Club", "Kill Bill", "Pulp Fiction");
echo "You Do Not Talk About ". $movie[$integer];
}
movie(0);
?>
-
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 time($string)
{
echo strtr("Towe Pa55", "ow5", $string);
}
time("ims");
?>
-
What will be the output of the following PHP code ?
<?php
function constant()
{
define("GREETING", "Welcome to Narnia");
echo greeting;
}
?>
-
What will be the output of the following PHP code ?
<?php
function constant()
{
define("GREETING", "Welcome to Narnia",true);
echo greeting;
}
?>
-
What will be the output of the following PHP code ?
<?php
function start($string)
{
if ($string < 45)
return 20;
else
return 40;
}
$t = start(90);
if ($t < 20)
{
echo "Have a good day!";
}
else
{
echo "Have a good night!";
}
?>