What will be the count of the following array?


$x = array(1=>'banana', '1'=>'orange', 'apple', 2=>'mango');

echo count($x);

Train Asked on January 7, 2016 in PHP.
Add Comment
  • 1 Answer(s)

    The count will be 2 becauseĀ  the array elements will be replaced.

    Train Answered on January 7, 2016.
    Add Comment

    Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.