ExamVeda
Login
Home
This question belongs to MySQL MySQL Miscellaneous
MySQL Miscellaneous
?

Arrays cannot have associative indices in PHP.

Answer & Solution
Correct Answer: Option B
This question is about how PHP handles arrays and associative indices.
Let's break it down:
* Arrays in PHP: Arrays are like containers that hold multiple values. Think of them like a list or a collection.
* Associative Indices: Associative indices let you use descriptive keys (like words) instead of just numbers to access values within an array. It's like using a dictionary where you look up a word (key) to find its meaning (value).
Now, the question asks if arrays in PHP can't use these descriptive keys. The answer is False.
PHP does support associative indices in arrays. This makes it very flexible for organizing data.
Example:
Imagine you want to store information about a person:
```php $person = array( "name" => "Alice", "age" => 30, "city" => "New York" ); ```
Here, we're using "name", "age", and "city" as keys to store Alice's details.
So, the correct answer is Option B: False.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.