PHP
PHP
PHP
i) $3hello a) \r
ii) $_hello b) \n
iii) $this c) /n
iv) $This d) /r
a) All of the mentioned 5. What will be the output of the following PHP
code?
b) Only ii)
<?php
c) ii), iii) and iv)
$num = 10;
d) ii) and iv)
echo 'What is her age? \n She is $num years
2. Which of the following PHP statements will old';
output Hello World on the screen?
?>
i) echo (“Hello World”);
a) What is her age? \n She is $num years old
ii) print (“Hello World”);
b) What is her age?
iii) printf (“Hello World”);
She is $num years old
iv) sprintf (“Hello World”);
c) What is her age? She is 10 years old
a) i) and ii)
d) What is her age?
b) i), ii) and iii)
She is 10 years old
c) All of the mentioned
6. Which of the conditional statements is/are
d) i), ii) and iv) supported by PHP?
3. Which of the below statements is equivalent i) if statements
to $add += $add ?
ii) if-else statements
a) $add = $add
iii) if-elseif statements
b) $add = $add +$add
iv) switch statements
c) $add = $add + 1
a) Only i)
d) $add = $add + $add + 1
b) i), ii) and iv)
c) ii), iii) and iv) c) 0
7. If $a = 12 what will be returned when ($a == 11. Which one of the following is the right way
12) ? 5 : 1 is executed? of defining a function in PHP?
{ c) Error
<?php ?>
{ b) Error
{ d) helloblablablabla
b();
a();
?>
a) I am b