Vidyalelo
MySQL · Q278

MySQL

Programming · MySQL · question 278

Q278

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

A.
$a[1]
B.
$a[0]
Answer
C.
$a.1
D.
$a.0

Answer: Option B

Solution

Answer: Option B
Solution:
This question is asking about how to access the very first item in an array called "$a". Arrays in PHP are like lists, and each item has a number called an index. These indices start from zero.

Think of it like a numbered list:
* The first item is at index 0.
* The second item is at index 1.
* And so on.

So, to get the first element of the array "a[0]".

Therefore, the correct answer is Option B: $a[0].