Welcome to your PHP Programming MCQ
1.
PHP scripts are enclosed within which tags?
PHP scripts are enclosed within which tags?
2.
How do you check if a variable is set in PHP?
How do you check if a variable is set in PHP?
3.
How do you retrieve the value of a cookie in PHP?
How do you retrieve the value of a cookie in PHP?
4.
Which function is used to close a MySQL connection in PHP?
Which function is used to close a MySQL connection in PHP?
5.
What is the correct way to end a PHP statement?
What is the correct way to end a PHP statement?
6.
How do you fetch a result row as an associative array in PHP?
How do you fetch a result row as an associative array in PHP?
7.
How do you select a database in PHP?
How do you select a database in PHP?
8.
What is the purpose of the $_POST variable in PHP?
What is the purpose of the $_POST variable in PHP?
9.
How do you set a session variable in PHP?
How do you set a session variable in PHP?
10.
How do you escape special characters in a string for use in an SQL statement in PHP?
How do you escape special characters in a string for use in an SQL statement in PHP?
11.
How do you set a cookie in PHP?
How do you set a cookie in PHP?
12.
How do you count the number of elements in an array in PHP?
How do you count the number of elements in an array in PHP?
13.
What is the correct way to include the content of one PHP file into another PHP file?
What is the correct way to include the content of one PHP file into another PHP file?
14.
Which function is used to start a session in PHP?
Which function is used to start a session in PHP?
15.
What does PHP stand for?
16.
How do you check if a variable is empty in PHP?
How do you check if a variable is empty in PHP?
17.
How do you create a function in PHP?
How do you create a function in PHP?
18.
How do you free the memory associated with a result in PHP?
How do you free the memory associated with a result in PHP?
19.
Which function is used to open a file in PHP?
Which function is used to open a file in PHP?
20.
Which symbol is used to start a variable in PHP?
Which symbol is used to start a variable in PHP?
21.
PHP is a _______ scripting language.
PHP is a _______ scripting language.
22.
What is the purpose of the $_GET variable in PHP?
What is the purpose of the $_GET variable in PHP?
23.
How do you call a user-defined function in PHP?
How do you call a user-defined function in PHP?
24.
How do you destroy a session in PHP?
How do you destroy a session in PHP?
25.
Which function is used to send an email in PHP?
Which function is used to send an email in PHP?
26.
How do you create an array in PHP?
How do you create an array in PHP?
27.
Which function is used to read a file line by line in PHP?
Which function is used to read a file line by line in PHP?
28.
What is the correct way to connect to a MySQL database in PHP?
What is the correct way to connect to a MySQL database in PHP?
29.
How do you write a comment in PHP?
How do you write a comment in PHP?
30.
How do you add an element to an array in PHP?
How do you add an element to an array in PHP?