Q. Which of these is a correct way to declare an array in PHP?

  • (A) array = (1,2,3);
  • (B) $arr = array(1,2,3);
  • (C) $arr = [1,2,3];
  • (D) Both 2 and 3
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both 2 and 3
Explanation: PHP supports both array() and [] syntax to declare arrays.
Explanation by: Rati Dubey
PHP supports both array() and [] syntax to declare arrays.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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