A

Admin • 832.27K Points
Coach

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
  • Correct Answer - Option(D)
  • Views: 14
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin

PHP supports both array() and [] syntax to declare arrays.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.