PHP Quiz Php Quiz 1 / 20What does PHP stand for? Personal Home Page Hypertext Preprocessor Preprocessed Hypertext Pages Page Hypertext Processor 2 / 20Which symbol is used to declare a variable in PHP? % & $ # 3 / 20How do you create a comment in PHP? // This is a comment # This is a comment /* This is a comment */ All of the above 4 / 20Which function is used to output text in PHP? echo() print() printf() All of the above 5 / 20What is the correct way to end a PHP statement? . ; : | 6 / 20Which of the following is the correct way to include a file in PHP? include 'filename.php'; include('filename.php'); require 'filename.php'; All of the above 7 / 20Which of the following is a valid PHP variable name? $1name $_name $na-me $na&me 8 / 20How do you declare a constant in PHP? define('CONSTANT_NAME', 'value'); const CONSTANT_NAME = 'value'; constant('CONSTANT_NAME', 'value'); Both a and b 9 / 20What is the output of the following code?$a = 5;$b = 10;echo $a + $b;Click on Extem for view full code 510 15 5 + 10 Error 10 / 20Which of the following is used to connect to a MySQL database in PHP? mysql_connect() mysqli_connect() pdo_connect() db_connect() 11 / 20How do you retrieve data from a form that uses the "POST" method in PHP? $_GET['field_name'] $_POST['field_name'] $_REQUEST['field_name'] $_FORM['field_name'] 12 / 20Which of the following is the correct way to start a session in PHP? session_start(); start_session(); session_begin(); begin_session(); 13 / 20What is the purpose of the isset() function in PHP? To check if a variable is set and not null To set a variable To check if a variable is empty To destroy a session 14 / 20Which function is used to end a script execution in PHP? die() exit() stop() Both a and b 15 / 20How can you create an array in PHP? $arr = array("value1", "value2", "value3"); $arr = ["value1", "value2", "value3"]; $arr = array("value1" => "value2", "value3"); Both a and b 16 / 20What is the correct way to create a function in PHP? function myFunction() {} create myFunction() {} define myFunction() {} func myFunction() {} 17 / 20What is the output of the following code?$x = array(1, 2, 3, 4);echo count($x);click on Extem for view full code 3 4 5 Error 18 / 20Which of the following is the correct way to add a new element to an array in PHP? $array[] = 'new value'; array_add($array, 'new value'); $array.add('new value'); $array.add('new value'); 19 / 20How do you access a global variable inside a function in PHP? global $variable; $GLOBALS['variable']; use $variable; Both a and b 20 / 20Which of the following is used to check if a file exists in PHP? file_exist('filename'); file_exists('filename'); is_file('filename'); file_check('filename'); Your score isThe average score is 63% 0% Restart quiz