Checkbox unchecked value arrays

  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Joined: Jul 18, 2008
  • Posts: 239
  • Loc: Western Australia
  • Status: Offline

Post July 10th, 2009, 9:41 am

I'm getting this array:

Code: [ Select ]
Array ( [Monday] => 1,0,0 [Tuesday] => 1,1,0 [Wednesday] => 1,1,1 [Thursday] => 0,1,1 [Friday] => 0,0,1 ...


But when I try this:

Code: [ Select ]
for ($i = 0; $i < count($unitcode); ++$i) {
echo "$monday[$i], $tuesday[$i], $wednesday[$i], $thursday[$i], $friday[$i]";
}
  1. for ($i = 0; $i < count($unitcode); ++$i) {
  2. echo "$monday[$i], $tuesday[$i], $wednesday[$i], $thursday[$i], $friday[$i]";
  3. }


It gives me

Code: [ Select ]
1, 1, 1, 0, 0
,, ,, ,, ,, ,
0, 1, 1, 1, 0
  1. 1, 1, 1, 0, 0
  2. ,, ,, ,, ,, ,
  3. 0, 1, 1, 1, 0


That's the right orientation, but the second piece of data if moved to the end, and where it should be is missing.

Demo: http://uwadb.com/timetable/setup.php?id=cal
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 10th, 2009, 9:41 am

  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Joined: Jul 18, 2008
  • Posts: 239
  • Loc: Western Australia
  • Status: Offline

Post July 10th, 2009, 9:45 am

Silly me, I forgot to explode it first. Works perfectly now, thanks a10^6.

Post Information

  • Total Posts in this topic: 17 posts
  • Users browsing this forum: No registered users and 159 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.