NEW
Font size
WorksheetsWeb Development
Total questions: 20
Worksheet time: 10mins
Which of the looping statements is/are supported by PHP?
i) for loop
ii) while loop
iii) do-while loop
iv) foreach loop
(i) and (ii)
(i), (ii) and (iii)
All of the mentioned
None of the mentioned
Which of the following is/are a PHP code editor? ditor?
i) Notepad
ii) Notepad++
iii) Adobe Dreamweaver
iv) PDT
Only (iv)
All of the mentioned.
(i), (ii) and (iii)
Only (iii)
Which of the following must be installed on your computer so as to run PHP script?
i) Adobe Dreamweaver
ii) PHP
iii) Apache
iv) IIS
All of the mentioned
Only (ii)
(ii) and (iii)
(ii), (iii) and (iv)
Which of the below symbols is a newline character?
\r
\n
/n
/r
If $a = 12 what will be returned when ($a == 12) ? 5 : 1 is executed?
12
1
Error
5
Which of the following PHP statements will output Hello World on the screen?
(i) echo (“Hello World”);
(ii) print (“Hello World”);
(iii) printf (“Hello World”);
(iv) sprintf (“Hello World”);
(i) and (ii)
(i), (ii) and (iii)
(i), (ii) and (iv)
All of the mentioned
< ?php
$color = "maroon";
$var = $color[2];
echo "$var" ;
?>
a
error
$var
r
< ?php
$total = "25 students";
$more = 10;
$total = $total + $more;
echo "$total" ;
?>
Error
35 students
25 students
35
What will be the output of the following PHP code?
< ?php
$score = 1234;
$scoreboard = (array) $score;
echo $scoreboard[0];
?>
1
Error
1234
2
Which statement will output $x on the screen?
echo “\$x”;
echo “$$x”;
echo “/$x”;
echo “$x;
Which of the below statements is equivalent to $add += $add ?
$add = $add
$add = $add +$add
$add = $add + 1
$add = $add + $add + 1
What will be the output of the following PHP code?
< ?php
$team = "arsenal";
switch ($team) {
case "manu":
echo "I love man u";
case "arsenal":
echo "I love arsenal";
case "manc":
echo "I love manc"; }
?>
I love arsenal
I love arsenalI love manc
Error
I love arsenalI love mancI love manu
What will be the output of the following PHP code?
< ?php
$num = 10;
echo 'What is her age? \n She is $num years old';
?>
What is her age? \n She is $num years old
What is her age? She is 10 years old
What is her age?
She is $num years old
What is her age?
She is 10 years old
What will be the output of the following PHP code?
< ?php
$a = "clue";
$a .= "get";
echo "$a";
?>
get
true
False
Clueget
11. Which of the following php statement/statements will store 111 in variable num?
i) int $num = 111;
ii) int mum = 111;
iii) $num = 111;
iv) 111 = $num;
Both (i) and (ii)
All of the Mentioned
only (iii)
only (i)
What will be the output of the following php code?
< ?php
$num = "1";
$num1 = "2";
print $num+$num1 ;
?>
3
1+2
error
12
Which of following variables can be assigned a value to it?
(i) $3hello
(ii) $_hello
(iii) $this
(iv) $This
All of the mentioned
Only (ii)
(ii), (iii) and (iv)
(ii) and (iv)
What will be the output of the following code
< ?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>
Error
My name is BobBob
My name is BobMy name is Bob
My name is Bob Bob
< ?php
function track() {
static $count = 0;
$count++;
echo $count ;
}
track();
track();
track();
?>
123
111
000
011
Which of the following attribute is needed for file upload via form?
enctype='multipart/form-data'
enctype='singlepart/data'
enctype='file'
enctype='form-data/file'
