wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PHP Basics

Total questions: 15

Worksheet time: 7mins

Name
Class
Date
1.

PHP stands for

a)

Hypertext processor

b)

Homepage processor

c)

Hypertext preprocessor

2.

PHP is a____________side scripting language

a)

server

b)

browser

c)

client

3.

The file extension for PHP files is __________.

a)

.html

b)

.php

c)

.css

d)

.java

4.

Which tag is used for php

a)

<?php

?>

b)

<?php

>

c)

<php

?>

d)

<php

/php>

5.

Which of the following is used to end a statement in PHP?

a)

. (dot)

b)

; (semicolon)

c)

! (exclamation)

d)

/ (slash)

6.

Which of the following is not true?

a)

PHP can be used to develop web applications.

b)

PHP makes a website dynamic

c)

PHP can not be embedded into html.

d)

None of these

7.

All variables in PHP start with which symbol?

a)

?

b)

$

c)

!

d)

=

8.

How do we display the values of the variable "name" ?

a)

$name;

b)

include $name;

c)

echo $name;

d)

echo $name

9.

Which of the following is the correct way of defining a variable in PHP?

a)

$variable name = value;

b)

$variable_name = value;

c)

$variable_name = value

d)

$variable name as value;

10.

How can we use variable in php?

a)

$a=5;

b)

var a=5;

c)

int a=5;

d)

$a=5

11.

Find the output

<?php

$x = 5;

$y= 10;

echo $x;

echo $y;

?>

a)

105

b)

510

c)

5

10

d)

10

5

12.

$a = 4 ; $b = 6; $c = $a + $b; What is the value of variable "c" ?

a)

6

b)

8

c)

10

d)

None

13.

The * operator belongs to which category of operators?

a)

Arithmetic operator

b)

Logical operator

c)

Comparison operator

d)

Conditional operator

14.

_______ is a concatenation operator in php

a)

+ (plus)

b)

+=

c)

. (dot)

d)

, (comma)

15.

What is the Output


<?php

$color=red;

echo "$color";

?>

a)

red

b)

$color

c)

No answer

d)

Error