Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

12/4/22, 10:23 PM PHP hypertext preprocessor

NAME : 
CLASS : 
PHP hypertext preprocessor
20 Questions DATE  : 

1. Which one of these variables has an illegal name?

A $my-Var B $myVar

C $my_Var

2. How do you create an array in PHP?

A $cars = "Volvo", "BMW", "Toyota"; B $cars = array("Volvo", "BMW", "Toyota");

C $cars = array["Volvo", "BMW", "Toyota"];

3. What are the two types of array in php

A Associative, sequence B Indexed, associative

C Indexed, sequence D None

4. The 2 basic ways to get output in PHP are __________.

A echo and cout B echo and scan

C echo and print

5. _______ is a concatenation operator in php

A + (plus) B . (dot)

C +=

6. 1. All variables in PHP start with which symbol?

A & B !

C $
https://quizizz.com/print/quiz/63806391b4718f001d02c1bb 1/5
12/4/22, 10:23 PM PHP hypertext preprocessor

7. What is the step to create database?

A Open localhost/phpmyadmin/ B Open browser/Notepad++

C Open NetBeans/New Project/

8. The default file extension for PHP files is __________.

A .java B .css

C .html D .php

9. PHP is a____________side scripting language

A browser B server

C client

10. Who is the father of PHP?

A List Barely B Drek Kolkevi

C Willam Makepiece D Rasmus Lerdorf

11. How do you write "Hello World" in PHP

A Document.Write("Hello World"); B echo "Hello World";

C "Hello World";

12. Choose the equivalent of the statement : $sub -= $sub.

A $sub = $sub - 1 B $sub = - $sub

C $sub = $sub - $sub D $sub = $sub - $sub -1

https://quizizz.com/print/quiz/63806391b4718f001d02c1bb 2/5
12/4/22, 10:23 PM PHP hypertext preprocessor

13. find the output


<?php
$x = 1;
$x += 1;

echo $x;
?>

A 1 B 2

C 0

14. <?php $fruits = array ("apple", "orange", array ("pear", "mango"),"banana");


echo (count($fruits, 1)); ?>
What is the output of the php code?

A 3 B 6

C 4 D 5

15. Which of the following is not true?

PHP can be used to develop web


A PHP makes a website dynamic B
applications.

C PHP can not be embedded into html.

16. Which of the following array represents an array with strings as index?

A Multidimentional Array B Numeric Array

C Associative Array

17. PHP server scripts are surrounded by delimiters, which?

A B

18. What does PHP stands for?

A PHP: Hypertext Preprocessor B Personal Hypertext Processor

C Private Home Page


https://quizizz.com/print/quiz/63806391b4718f001d02c1bb 3/5
12/4/22, 10:23 PM PHP hypertext preprocessor

19. What will be the output of the following program?

<?php $var1 = "Hello"; $var2 = "World"; echo "$var1$var2"; ?>

A HelloWorld B None of the above

C "$var1$var2" D Hello World

20. Find the output


<?php
$x = 5;
{ $x = 10;
echo $x;
}
echo $x;
?>

A 105 B 1010

C 510

https://quizizz.com/print/quiz/63806391b4718f001d02c1bb 4/5
12/4/22, 10:23 PM PHP hypertext preprocessor

Answer Key

1.a 2.b 3.b 4.c

5.b 6.c 7.a 8.d

9.b 10.d 11.b 12.c

13.b 14.b 15.c 16.c

17.a 18.a 19.a 20.b

https://quizizz.com/print/quiz/63806391b4718f001d02c1bb 5/5

You might also like