Loading...
QUIZ

Certification Test

 
Que No. 1 ) How do you start a multi-line comment in PHP?

A.) // This is a comment
B.) /* This is a comment */
C.) # This is a comment
D.) -- This is a comment


Que No. 2 ) What is the purpose of the PHP "foreach" loop?

A.) To create a conditional loop
B.) To iterate over the elements of an array or iterable
C.) To generate random numbers
D.) To define a function


Que No. 3 ) How do you get the current date and time in PHP?

A.) get_date_time()
B.) date("Y-m-d H:i:s")
C.) current_datetime()
D.) now()


Que No. 4 ) What is the correct way to declare an array in PHP?

A.) array myArray;
B.) myArray = [];
C.) myArray = array();
D.) $myArray = [];


Que No. 5 ) Which PHP function is used to remove whitespace from the beginning and end of a string?

A.) trim()
B.) strip()
C.) clean()
D.) remove_whitespace()


Que No. 6 ) What is the purpose of the PHP "switch" statement?

A.) To define a function
B.) To create a loop
C.) To execute code conditionally based on multiple possible values
D.) To include external files


Que No. 7 ) Which PHP function is used to check if a file exists?

A.) file_exists()
B.) is_file()
C.) file_check()
D.) exists_file()


Que No. 8 ) How do you define a global variable in PHP?

A.) global myVariable;
B.) var myVariable;
C.) $myVariable = global;
D.) $myVariable;


Que No. 9 ) What is the purpose of the PHP "unset()" function?

A.) To destroy a session
B.) To remove a variable
C.) To delete a file
D.) To clear an array


Que No. 10 ) Which PHP function is used to count the number of elements in an array?

A.) count()
B.) length()
C.) size()
D.) sizeof()