Arrays
Declare with
$avar = array(1,'two');
For indexing use [ ]. Arrays begin with zero element.
Use sizeof(array) function to get size of array.
Arrays can be iterated over using:
$val = reset($arr);
$max = sizeof($arr);for ($i=0; $i<$max; $i++) {
print "$val<BR>";
$val = next($arr);
}
/* or more simply */foreach ($arr as $element) print "$element<BR>";
COMMENTS http://php.weblogs.com/php_jscript_vbscript_1
|