Google News
logo
MySQL - Quiz(MCQ)
In PHP, if $a represents an array with numeric indices, how is the first element accessed?
A)
$a.0
B)
$a.1
C)
$a[0]
D)
$a[1]

Correct Answer :   $a[0]


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].

Advertisement