Loading...
QUIZ

Certification Test

 
Que No. 1 ) What is the correct way to create a constant array in PHP?

A.) const MY_ARRAY = [1, 2, 3];
B.) define MY_ARRAY = [1, 2, 3];
C.) $MY_ARRAY = constant([1, 2, 3]);
D.) create MY_ARRAY = [1, 2, 3];


Que No. 2 ) What is the purpose of the PHP "break" statement?

A.) To exit a loop or switch statement
B.) To continue to the next iteration of a loop
C.) To include external files
D.) To define a function


Que No. 3 ) Which PHP function is used to replace all occurrences of a substring in a string?

A.) replace()
B.) str_replace()
C.) replace_all()
D.) str_replace_all()


Que No. 4 ) How do you declare a constant in PHP?

A.) var MY_CONSTANT = 123;
B.) define MY_CONSTANT 123;
C.) const MY_CONSTANT = 123;
D.) $MY_CONSTANT = 123;


Que No. 5 ) What is the purpose of the PHP "continue" statement?

A.) To exit a loop or switch statement
B.) To skip the rest of the current iteration of a loop
C.) To include external files
D.) To define a function


Que No. 6 ) How do you declare a multi-dimensional array in PHP?

A.) myArray = [[1, 2], [3, 4]];
B.) myArray = {1: {2}, 3: {4}};
C.) $myArray = [1, [2, 3], [4, 5]];
D.) $myArray = [[1, 2], [3, 4]];


Que No. 7 ) What is the purpose of the PHP "array_push()" function?

A.) To remove an element from an array
B.) To add one or more elements to the end of an array
C.) To reverse the order of elements in an array
D.) To check if an array is empty


Que No. 8 ) How do you define a constant with a case-insensitive name in PHP?

A.) const MY_CONSTANT = 123;
B.) define("MY_CONSTANT", 123);
C.) const my_constant = 123;
D.) define(MY_CONSTANT, 123);


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

A.) To remove the first element from an array
B.) To add one or more elements to the beginning of an array
C.) To remove the last element from an array
D.) To check if an array is empty


Que No. 10 ) How do you check if a variable is set in PHP?

A.) isset($variable)
B.) is_set($variable)
C.) set($variable)
D.) check_set($variable)