In PHP, if $a represents an array with numeric indices, how is the first element accessed?

In PHP, if $a represents an array with numeric indices, how is the first element accessed?
A. $a[1]
B. $a[0]
C. $a.1
D. $a.0
 
Answer: b
Explanation: If $a represents an array with numeric indices, its elements are accessed as $x[0], $x[1], and so on. In general terms, each element at the position i is accessed and used as $a[i – 1].
 

Tìm kiếm

Back
Top