View Single Post
Old 07-08-2004, 03:23 PM   #10 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,487
sde is on a distinguished road
no, it will generate an error if the variable is not declared as an array.

for example:
PHP Code:
<?
// bad, this will generate an error
// since $myarray as not been declared as an array
foreach($myarray as $each){
  
// do something
}

// this next one is ok because
// php knows that $myarray is an array
// now it will skip the foreach and not generate an error
$myarray = array();
foreach(
$myarray as $each){
  
// do something
}
?>
__________________
Mike
sde is offline   Reply With Quote