> -----Original Message----- > From: leledumbo [mailto:leledumbo_c...@yahoo.co.id] > Sent: 10 August 2009 11:11 > To: email@example.com > Subject: RE: [PHP] Radio buttons problem > > > > Why do you? There's no reason you *have* to have consecutive > indexes -- > just iterate over the resulting > array with foreach, and there's no > problem. > > There is, the entries are grouped by its index. So, I group name, > email, and sex as one. The problem if I don't maintain the > index for > radio buttons, the index could go wrong. > > In the previous example I gave, if entry2 is deleted (and I don't > maintain > the index) then entry3 will contain name, email, and sex > which > isn't desirable.
Huh??? If you have entries for: name, email, sex name, email, sex name, email, sex ... and then delete the entry containing sex, why wouldn't you just end up with name, email, sex name, email, sex ... ??? Unless, of course, what you have is name, email, sex name, email, sex name, email, sex ... ... in which case, don't do that! If it's important to you that the indexes match across name, email and sex, then you must supply them explicitly for every field in the group -- if you name some of the fields with , and some with explicit ,  indexes, you're setting yourself up for exactly this kind of mismatch problem when you come to delete (or insert!) entries. Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php