PHP Quiz (Set 5) PHP (Set 5) 1 / 10 What is the purpose of the 'extract()' function in PHP? To extract elements from an array and create variables To compress an array and save it as a ZIP file To extract elements from a string To extract elements from a database result set 2 / 10 What is the purpose of the 'header()' function when used with a location parameter in PHP? To define the layout and design of a webpage To redirect the user to a different page To include external CSS files To include external JavaScript files 3 / 10 What is the purpose of the 'nl2br()' function in PHP? To remove line breaks from a string To replace newlines with line break HTML tags in a string To convert HTML entities to their corresponding characters To escape special characters in a string 4 / 10 What is the purpose of the 'strtotime()' function in PHP? To convert a timestamp into a formatted date string To calculate the difference between two dates To convert a date string into a timestamp To compare two dates 5 / 10 What is the purpose of the 'strlen()' function in PHP? To count the number of words in a string To reverse the characters in a string To check if a string contains a specific substring To count the number of characters in a string 6 / 10 What is the purpose of the 'foreach()' loop in PHP? To loop through a range of numbers To loop through the elements of an array or an object To loop through the keys of an array To loop through a string character by character 7 / 10 What is the purpose of the 'header()' function in PHP? To define the layout and design of a webpage To include external CSS files To send HTTP headers to the browser To include external JavaScript files 8 / 10 What is the difference between '=='' and '===' operators in PHP? '==' performs a loose comparison, while '===' performs a strict comparison including the type '==' performs a strict comparison, while '===' performs a loose comparison '==' compares two values, while '===' compares two variables '==' compares two variables, while '===' compares two values 9 / 10 What is the purpose of the 'include()' function in PHP? To include a CSS file in an HTML document To import a PHP file into another PHP file To include a JavaScript file in an HTML document To include a font file in a web page 10 / 10 What is the purpose of the 'isset()' function in PHP? To check if a variable is defined and not null To unset a variable To check if a variable is empty To check if a variable is numeric Your score isThe average score is 0% 0% Restart quiz