Cooly Wizardy Cooly Wizardy - 1 year ago 85
PHP Question

What are Arrays in PHP

As per standard Array definition: An array is a variable which allows you to store multiple value of same Data Type.

In PHP, say


What will be $a[0]
, $a[1]
and $a[2]
treated as String, Numeric value or character value and Why?

flo flo
Answer Source

Arrays in PHP are different, there's only one type of array which an store different types. in Your example the items keep their original type. abc is a String, 123 is a number and 4 is a string.

You can even have nonnumeric keys. For Example $a["a"] = "test".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download