looping an associative array
Posted: Thu Mar 20, 2008 11:57 am
if i have an associative array like this:
how can i loop through it? i tried something like this:
and
which are the same thing, but how can i loop through that?
Code: Select all
Array ( [facility_num] => asdfas [facility] => dsa [attention] => asdf [title] => asdf [address] => asdf [suite] => asfas [city] => asdfsasdafsw [state] => asdf [zip] => 2423 [contact_num] => 33df [dvd_qty] => 35d [vhs_qty] => a )
Code: Select all
for($i=0;$i<count($rf);$i++)
{
echo ($rf[$i]."<br>");
}
Code: Select all
$i=0;
while($i<=count($rf))
{
echo ($rf[$i]."<br>");
$i++;
}