Beruflich Dokumente
Kultur Dokumente
A. Error
B. My name is BobBob
C. My name is BobMy name is Bob
D. My name is Bob Bob
8. 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);
A. i)and ii)
B. i), ii) and iii)
C. All of the mentioned
D. i), ii) and iv)
9. What will be the output of the following PHP code?
<?php
$color = "maroon";
$var = $color[2];
echo "$var";
?>
A. a
B. Error
C. $var
D. R
<?php
$a = "clue";
$a .= "get";
echo "$a";
?>
A. get
B. true
C. false
D. clueget
<?php
$total = "25 students";
$more = 10;
$total = $total + $more;
echo "$total";
?>
A. Error
B. Students
C. 35
D. 25 students
12. Which two predefined variables are used to retrieve information from forms?
A. $GET & $SET
B. $_GET & $_SET
C. $__GET & $__SET
D. GET & SET
<?php
echo "Hello world </br> I am learning PHP";
?>
A. Hello world
C. Error
D. Hello world
I am learning PHP
<?php
echo "Hello world <strong>I am learning PHP</strong>"
?>
A. Hello world
B. Hello world I am learning PHP
C. Hello world
I am learning PHP
D. Error
15. What will be the output of the following PHP code ?
<?php
echo "This", "was", "a", "bad", "idea";
?>
A. This, was, a, bad, idea
C. Thiswasabadidea
D. Error
<?php
echo "This"."was"."a"."bad"."idea";
?>
A. This, was, a, bad, idea
C. Thiswasabadidea
D. Error
<?php
$one = "Hello";
$two = "World";
echo $one, $two;
?>
A. Hello World
B. Hello
C. World
D. HelloWorld
<?php
$one = "Hello";
$two = "World";
echo "$one$two";
?>
A. HelloWorld
B. $one$two
C. Hello
D. Error
19. What will be the output of the following PHP code ?
<?php
$one = "Hello";
$two = "World";
echo "$one"+"$two";
?>
A. HelloWorld
B. Hello+World
C. 0
D. Error
20. What will be the output of the following PHP code ?
<?php
echo "This is <i>India</i>";
?>
A. This is India
B. This is Ind
C. This is
D. Error
<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "My car is a {$cars[0]}";
?>
A. My car is a Volvo
B. My car is a BMW
C. My car is a Toyota
D. Error
<?php
print "echo hello world";
?>
A. echo hello world
B. hello world
C. Nothing
D. Error
<?php
$one = 1;
print($one);
print $one;
?>
A. 01
B. 11
C. 10
D. Error
<?php
$cars = array("Volvo", "BMW", "Toyota");
print $cars[2];
?>
A. Volvo
B. BMW
C. Toyota
D. Error
<?php
$one = "one";
$two = "two";
print($one$two);
?>
A. onetwo
B. one
C. Nothing
D. Error
<?php
$one = "one";
$two = "two";
print($one,$two);
?>
A. onetwo
B. one, two
C. one
D. Error
<?php
$one = "one";
$two = "two";
print("$one$two");
?>
A. onetwo
B. $one$two
C. One
D. Error
<?php
$one = "one";
$two = "two";
print($one==$two);
?>
A. true
B. false
C. Nothing
D. Error
<?php
$one = "one";
$two = "one";
print($one == $two);
?>
A. true
B. false
C. 1
D. Error
<?php
print "Hello world!<br>";
print "I'm about to learn PHP!";
?>
A. Hello world!