A

Admin • 833K Points
Coach

Q. Which of the following is the correct way to declare an array in PHP?

  • (A) $arr = array(1, 2, 3);
  • (B) $arr = [1, 2, 3];
  • (C) Both option1 and option2
  • (D) None of the above
  • Correct Answer - Option(C)
  • Views: 32
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin

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

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.