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
πŸ’¬ Discuss
βœ… Correct Answer: (A) 3
Explanation: end() advances array pointer to last element and returns its value.
Explanation by: Rati Dubey
end() advances array pointer to last element and returns its value.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
82
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Rati Dubey
Publisher
πŸ“ˆ
95%
Success Rate