NEW
Font size
WorksheetsIntroduction to PHP
Total questions: 15
Worksheet time: 16mins
PHP stands for ______________
PHP:Hypermedia Preprocessor
PHP:Hypertext Postprocessor
PHP:Hypertext Preprocessor
PHP:Hypermedia Postprocessor
Variable names in PHP begins with ________ sign.
$
%
#
&
In PHP string belongs to _________ datatype.
Compound data
scalar data
special data
unique data
Array belongs to ________ data type in PHP.
Compound data
scalar data
special data
unique data
What will be the output of the following PHP code? <?php $x = 23; echo ( $x ===23 ); ?>
Displays “” (false)
Displays 1 (true)
Displays 24
Displays 23
In PHP the _____ loop will always execute the block of code once, it will then check the condition, and repeat the loop while the specified condition is true.
for
while
do...while
foreach
What will be the output of the following PHP code? <?php $x = 2; $y = 3; echo ( ($x == 2) xor ($y == 3) ); ?>
Displays (false)
Displays 1 (true)
Displays 2
Displays 3
What type of language is PHP?
Server side scripting
Client side scripting
User defined scripting
None
Choose the equivalent of the statement : $sub -= $sub.
$sub=$sub-1;
$sub=$sub-$sub;
$sub=$sub
$sub=$sub-$sub
Total looping techniques supported by PHP are?
3
22
4
1
<?php $x = 10; $y = 20; if ($x > $y && 1||1) echo "1000 PHP MCQ" ; else echo "Welcome to Sanfoundry"; ?>
no output
Welcome to Sanfoundry
1000 PHP MCQ
error
Which of the following is used for concatenation in PHP?
+ (plus)
* (Asterisk)
. (dot)
append()
<?php
$a = 0;
while ($a++)
{
echo "$a";
}
echo $a;
?>
0
1
01
none
<?php
$a = "1";
switch($a)
{
case 1:
echo "Hello";
case 2:
echo "World";
default:
echo "This is php.com";
}
?>
HelloWorld
This is javaTpoint.com
Hello
HelloWorldThis is php.com
<?php
$a=0;
if ($a)
{
echo "hi";
}
else
{
echo "How are you";
}
?>
Hi How are you
How are you
Hi
None of the above
