MCQs > IT & Programming > PHP > Given the following array: $array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red'); Which will print 2?

PHP MCQs

Given the following array:
$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
Which one of the following will print 2?

Answer

Correct Answer: echo array_search('green', $array);

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it