CSE :: PHP - CS
-
What will be the output of the following PHP code?
<?php
echo ucwords("i love my country");
?>
-
What will be the output of the following PHP code?
<?php
echo lcfirst("welcome to India");
?>
-
What will be the output of the following PHP code?
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
-
What will be the output of the following PHP code?
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
a();
a();
?>
-
What will be the output of the following PHP code?
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
b();
a();
?>
-
What will be the output of the following PHP code?
<?php
$op2 = "blabla";
function foo($op1)
{
echo $op1;
echo $op2;
}
foo("hello");
?>
-
What will be the output of the following PHP code?
<?php
function foo($msg)
{
echo "$msg";
}
$var1 = "foo";
$var1("will this work");
?>
- Which one of the following is the right way of defining a function in PHP?
-
What will happen in this function call?
<?php
function calc($price, $tax)
{
$total = $price + $tax;
}
$pricetag = 15;
$taxtag = 3;
calc($pricetag, $taxtag);
?>