PHP Quiz (Set 2) PHP (Set 2) 1 / 10 What is the '$_SESSION' superglobal used for in PHP? To store form data To store information that is visible to the user To store user-specific data across multiple pages To store global configuration settings 2 / 10 What is the purpose of the 'header()' function in PHP? To display a message on the webpage To include an external PHP file To send HTTP headers to the browser To set the character encoding of the webpage 3 / 10 What is the correct way to connect to a MySQL database using 'mysqli' in PHP? $conn = mysqli_connect('localhost', 'username', 'password', 'database'); $conn = mysql_connect('localhost', 'username', 'password', 'database'); $conn = connect('localhost', 'username', 'password', 'database'); $conn = new mysqli('localhost', 'username', 'password', 'database'); 4 / 10 What is the 'mysqli' extension used for in PHP? To manipulate XML data To perform image processing To work with MySQL databases To create user interfaces 5 / 10 What is the purpose of the 'implode()' function in PHP? To combine two or more strings To replace occurrences of a substring with another substring To split a string into an array of substrings based on a delimiter To join elements of an array into a string using a specified delimiter 6 / 10 What is the purpose of the 'explode()' function in PHP? To split a string into an array of substrings based on a delimiter To combine two or more strings To find the position of a substring within a string To replace occurrences of a substring with another substring 7 / 10 What does the 'array_push()' function do in PHP? Adds an element to the beginning of an array Removes the last element from an array Adds one or more elements to the end of an array Reverses the order of elements in an array 8 / 10 Which PHP function is used to return the length of an array? array_size() count() length() size() 9 / 10 What is the correct way to comment a single line in PHP? # This is a comment // This is a comment /* This is a comment */ # This is a comment // 10 / 10 What is the purpose of the 'isset()' function in PHP? To determine if a variable is set and not NULL To convert a variable to a string To check if a variable is empty To unset a variable Your score isThe average score is 0% 0% Restart quiz