View Single Post
Old 05-07-2004, 03:14 PM   #6 (permalink)
Epsilon
Regular Contributor
 
Epsilon's Avatar
 
Join Date: Mar 2003
Location: Las Vegas, NV
Posts: 127
Epsilon is on a distinguished road
Quote:
Originally posted by metazai
Well, I still couldn't get it to work, but then I changed the name of the array data in my form from "shows" to "shows[]" and then $shows was an array when PHP grabbed it. The "foreach" command now works on it perfectly, so thanks.
One note one this: if no boxes in the form are checked PHP will choke on the foreach command because it's not a valid array. I think the same might be true if only one box is checked, but I don't recall for sure. Anyway, you'll want to check the variable in your code first, maybe with is_array(), before you do a foreach.
__________________
--Epsilon--
Epsilon is offline   Reply With Quote