PHP Online Quiz


Advertisements


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.

Questions and Answers

Q 4 - Which of the following array represents an array containing one or more arrays?

A - Numeric Array

B - Associative Array

C - Multidimentional Array

D - None of the above.

Answer : C

Explanation

Multidimensional array − An array containing one or more arrays and values are accessed using multiple indices.

Q 5 - Which of the following function can be used to get an array in the reverse order?

A - array_reverse()

B - array_search()

C - array_shift()

D - array_slice()

Answer : A

Explanation

array_reverse() − Returns an array in the reverse order.

Q 6 - Which of the following function checks if a specified value exists in an array?

A - extract()

B - in_array()

C - key()

D - krsort()

Answer : B

Explanation

in_array() − Checks if a specified value exists in an array.

Q 7 - Which of the following is used to create a session?

A - session_start() function

B - $_SESSION[]

C - isset() function

D - session_destroy() function

Answer : A

Explanation

A PHP session is easily started by making a call to the session_start() function.

Q 8 - Which of the following provides the size of the uploaded file in PHP?

A - $_FILES['file']['tmp_name']

B - $_FILES['file']['name']

C - $_FILES['file']['size']

D - $_FILES['file']['type']

Answer : C

Explanation

$_FILES['file']['size'] − it provides the size of the uploaded file in PHP.

Q 9 - Which of the following method of Exception class returns source filename?

A - getMessage()

B - getCode()

C - getFile()

D - getLine()

Answer : C

Explanation

getFile() method of Exception class returns source filename.

Q 10 - Which of the following method can be used to close a MySql database using PHP?

A - mysql_connect()

B - mysql_query()

C - mysql_close()

D - None of the above

Answer : C

Explanation

PHP uses mysql_close function to close a MySQL database.


php_questions_answers.htm

Advertisements