1.

Which of the following PHP function will return true if a variable is an array or false if it is not an array?(a) this_array()(b) is_array()(c) do_array()(d) in_array()The question was posed to me at a job interview.This intriguing question comes from Arrays-1 in section Arrays and Functions of PHP

Answer»

Right answer is (b) is_array()

To elaborate: The function is_array() is an inbuilt function in PHP which is used to check whether a variable is an ARRAY or not. Its prototype FOLLOWS: boolean is_array(MIXED variable).



Discussion

No Comment Found

Related InterviewSolutions