Welcome to your PHP Programming MCQ
1.
PHP is a _______ scripting language.
PHP is a _______ scripting language.
2.
Which function is used to open a file in PHP?
Which function is used to open a file in PHP?
3.
How do you check if a variable is empty in PHP?
How do you check if a variable is empty in PHP?
4.
What does PHP stand for?
5.
What is the purpose of the $_POST variable in PHP?
What is the purpose of the $_POST variable in PHP?
6.
How do you set a cookie in PHP?
How do you set a cookie in PHP?
7.
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?
8.
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?
9.
How do you destroy a session in PHP?
How do you destroy a session in PHP?
10.
How do you select a database in PHP?
How do you select a database in PHP?
11.
How do you retrieve the value of a cookie in PHP?
How do you retrieve the value of a cookie in PHP?
12.
How do you free the memory associated with a result in PHP?
How do you free the memory associated with a result in PHP?
13.
How do you set a session variable in PHP?
How do you set a session variable in PHP?
14.
How do you create a function in PHP?
How do you create a function in PHP?
15.
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?
16.
How do you create an array in PHP?
How do you create an array in PHP?
17.
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?
18.
Which symbol is used to start a variable in PHP?
Which symbol is used to start a variable in PHP?
19.
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?
20.
Which function is used to close a MySQL connection in PHP?
Which function is used to close a MySQL connection in PHP?
21.
How do you add an element to an array in PHP?
How do you add an element to an array in PHP?
22.
How do you call a user-defined function in PHP?
How do you call a user-defined function in PHP?
23.
Which function is used to start a session in PHP?
Which function is used to start a session in PHP?
24.
What is the purpose of the $_GET variable in PHP?
What is the purpose of the $_GET variable in PHP?
25.
How do you write a comment in PHP?
How do you write a comment in PHP?
26.
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?
27.
How do you check if a variable is set in PHP?
How do you check if a variable is set in PHP?
28.
PHP scripts are enclosed within which tags?
PHP scripts are enclosed within which tags?
29.
What is the correct way to end a PHP statement?
What is the correct way to end a PHP statement?
30.
Which function is used to send an email in PHP?
Which function is used to send an email in PHP?