A

Admin • 833K Points
Coach

Q. How do you access the first element of the array $arr = [10, 20, 30]?

Code:
$arr = [10, 20, 30];
  • (A) $arr[0]
  • (B) $arr[1]
  • (C) $arr{0}
  • (D) $arr->0
  • Correct Answer - Option(A)
  • Views: 29
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin

Array indexing in PHP starts at 0.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.