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]); } Quote 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. Quote 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; Quote Link to comment https://forums.phpfreaks.com/topic/188399-read-array/#findComment-994594 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.