PHP3 Manual | ||
---|---|---|
Prev | Chapter 5. Syntax and grammar | Next |
PHP supports both scalar and associative arrays. In fact, there is no difference between the two. You can create an array using the array() function, or you can explicitly set each array element value.
$a[0] = "abc"; $a[1] = "def"; $b["foo"] = 13;
Arrays may be sorted using the sort(), ksort() and asort() functions depending on the type of sort you want.
You can count the number of items in an array using the count() function.
You can traverse an array using next() and prev() functions. Another common way to traverse an array is to use the each()
Prev | Home | Next |
Type juggling | Up | Language constructs |