ShaolinF Posted January 14, 2010 Share Posted January 14, 2010 Hi Guys How would I read out the following array data: for($j=0;$j<count($teachers);$j++) { $arr[$j] = array($teachers->teacher_id,$teacher_confirmations[$j]); } Link to comment https://forums.phpfreaks.com/topic/188399-read-array/ Share on other sites More sharing options...
oni-kun Posted January 14, 2010 Share Posted January 14, 2010 Well I can assume your FOR loop will never run as intended, as you're telling it to go until $j is less than $teachers, which is assumingly will always be. Link to comment https://forums.phpfreaks.com/topic/188399-read-array/#findComment-994590 Share on other sites More sharing options...
Andy-H Posted January 14, 2010 Share Posted January 14, 2010 foreach($arr as $k => $v) : echo $arr[$k][0] . "<br >\n"; // $teachers->teacher_id echo $arr[$k][1] . "<br >\n"; // $teacher_confirmations[$j]; endforeach; Link to comment https://forums.phpfreaks.com/topic/188399-read-array/#findComment-994594 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.