InterviewSolution
Saved Bookmarks
| 1. |
In PHP, how is the first element accessed if $a represents an array with numeric indices?(a) $a[1](b) $a[0](c) $a.1(d) $a.0This question was posed to me in an interview for internship.My question comes from General Preventative Maintenance topic in section Database Maintenance, Backups and Replication of MySQL |
|
Answer» CORRECT option is (b) $a[0] Easy 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]. |
|