A

Admin • 833.24K Points
Coach

Q. What will be the result of the following?

Code:
$array = [1, 2, 3];
echo end($array);
  • (A) 3
  • (B) 1
  • (C) 2
  • (D) Error
  • Correct Answer - Option(A)
  • Views: 22
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin

end() advances array pointer to last element and returns its value.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.