ProTechSolution
Home
Courses
Exercises
Quiz
Roadmaps
Experts
Login
Sign Up
Bootstrap 5 UI
Programming Concepts
HTML & CSS Masterclass
HTML
CSS
JavaScript
PHP
MySQL
Bootstrap 5
C#
PHP Certification Quiz
Test your knowledge to earn your official course certificate!
1. Which superglobal variable holds information about headers, paths, and script locations?
$_SESSION
$_SERVER
$_GLOBALS
$_GET
2. All variables in PHP start with which symbol?
!
$
&
#
3. Which variable is used to collect form data sent with both the GET and POST methods?
$_BOTH
$_REQUEST
$_FORMS
$_DATA
4. What is the correct way to create a function in PHP?
create myFunction()
function myFunction()
new_function myFunction()
def myFunction()
5. In PHP you can use both single quotes and double quotes for strings:
True
False
Only single quotes
Only double quotes
6. Which function is used to output the data type and value of a variable?
print_r()
var_dump()
type_dump()
dump_var()
7. Which operator is used to concatenate strings in PHP?
+
.
&
*
8. What is the correct way to include the file "time.inc"?
<?php include file="time.inc"; ?>
<?php include:"time.inc"; ?>
<?php include "time.inc"; ?>
<!-- include file="time.inc" -->
9. How do you write "Hello World" in PHP?
echo "Hello World";
"Hello World";
Document.Write("Hello World");
print_r "Hello World";
10. Which function is used to redirect a user to another page?
redirect()
header()
go()
location()
11. What is the correct way to open the file "time.txt" as readable?
fopen("time.txt","r");
open("time.txt");
open("time.txt","read");
fopen("time.txt","r+");
12. What does PHP stand for?
Personal Hypertext Processor
Private Home Page
PHP: Hypertext Preprocessor
Preprocessor Home Page
13. Include files must have the file extension ".inc":
True
False
Only in old PHP
Required by Apache
14. When using the POST method, variables are displayed in the URL:
True
False
Only in secure mode
Depends on the browser
15. The PHP syntax is most similar to:
VBScript
JavaScript
Perl and C
Python
16. How do you get information from a form that is submitted using the "get" method?
$_GET[];
Request.QueryString;
Request.Form;
$_POST[];
17. How do you add a single-line comment in PHP?
/* comment */
<comment>
// comment
<!-- comment -->
18. Which is the correct way to define an array in PHP?
$cars = array("Volvo", "BMW", "Toyota");
$cars = "Volvo", "BMW", "Toyota";
$cars = array["Volvo", "BMW", "Toyota"];
$cars = ("Volvo", "BMW", "Toyota");
19. What is the correct way to end a PHP statement?
</php>
.
;
New line
20. PHP server scripts are surrounded by delimiters, which?
<?php>...</?>
<&>...</&>
<?php...?>
<script>...</script>
Submit Quiz (20 Questions)