Following quiz provides Multiple Choice Questions (MCQs) related to PHP. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
true! PHP is a case sensitive language.
Q 2 - Which of the following type of variables have only two possible values either true or false?
Booleans: have only two possible values either true or false.
Q 3 - Which of the following is correct about constants?
Both of the above options are correct.
Q 4 - Which of the following magic constant of PHP returns class name?
_CLASS_ − The class name. (Added in PHP 4.3.0) As of PHP 5 this constant returns the class name as it was declared (case-sensitive). In PHP 4 its value is always lowercased.
Q 5 - Which of the following variable is used to generate random numbers using PHP?
The PHP rand() function is used to generate a random number. This function can generate numbers with-in a given range. The random number generator should be seeded to prevent a regular pattern of numbers being generated. This is achieved using the srand() function that specifiies the seed number as its argument.
Q 6 - If there is any problem in loading a file then the include() function generates a warning but the script will continue execution.
If there is any problem in loading a file then the include() function generates a warning but the script will continue execution.
Q 7 - Which of the following is used to delete a cookie?
To delete a cookie you should call setcookie() with the name argument only.
Q 8 - Which of the following is an array containing information such as headers, paths, and script locations?
$_SERVER − This is an array containing information such as headers, paths, and script locations. The entries in this array are created by the web server. There is no guarantee that every web server will provide any of these. See next section for a complete list of all the SERVER variables.
Q 9 - Which of the following method of Exception class returns source line?
getLine() method of Exception class returns source line.
Yes! class can be created in PHP.