CSE :: PHP - CS
-
What will be the output of the following code?
<?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>
-
Which of the following PHP statements will output Hello World on the screen?
1. echo (“Hello World”);
2. print (“Hello World”);
3. printf (“Hello World”);
4. sprintf (“Hello World”); -
What will be the output of the following PHP code?
<?php
$color = "maroon";
$var = $color[2];
echo "$var";
?>
-
What will be the output of the following PHP code?
<?php
$score = 1234;
$scoreboard = (array) $score;
echo $scoreboard[0];
?>
-
What will be the output of the following PHP code?
<?php
$total = "25 students";
$more = 10;
$total = $total + $more;
echo "$total";
?>
- Which of the below statements is equivalent to $add += $add ?
- Which statement will output $x on the screen?
-
What will be the output of the following code?
<?php
function track()
{
static $count = 0;
$count++;
echo $count;
}
track();
track();
track();
?>
-
What will be the output of the following PHP code?
<?php
$a = "clue";
$a .= "get";
echo "$a";
?>
-
What will be the output of the following PHP code?
<?php
$a = 5;
$b = 5;
span class="sys-fun">echo ($a === $b);
?>