Câu hỏi phỏng vấn PHP
Câu hỏi

What are the keys & values in an indexed array?

Câu trả lời

In an indexed array in PHP, the keys are automatically assigned by the language and are sequential integers starting from 0. The values are the actual data elements stored in the array.

For example, let's say we have an array like this:

php Copy
$fruits = array("apple", "banana", "cherry");

Here, the keys and values would be:

Key Value
0 "apple"
1 "banana"
2 "cherry"

The keys are 0, 1, and 2, while the values are "apple", "banana", and "c...

entry

entry

Gợi ý câu hỏi phỏng vấn

middle

Are Parent constructors called implicitly inside a class constructor?

junior

Give me some real life examples when you had to use __destruct in your classes

middle

Differentiate between parameterised and non parameterised functions

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào