me1000 Posted March 3, 2008 Share Posted March 3, 2008 so here is the array (which holds an array for each value) $data = array( array('name'=>'Title 1','number'=>"$intEnrolled") ,array('name'=>'Title 2','number'=>"$intCompleted") ,array('name'=>'Title 3','number'=>"$intExpired") ,array('name'=>'Title 4','number'=>"$intProgress") ); Now I need to get every value from the array... so I need like a foreach loop or something, but I need to get both values ('name' and 'number') I just dont know exactly how to do it, foreach (){ echo 'name'.' IS '.'number'; } which would display as Title 1 IS $intEnrolled Title 2 IS $intCompleted etc... I hope this makes since, Thanks, Quote Link to comment Share on other sites More sharing options...
teng84 Posted March 3, 2008 Share Posted March 3, 2008 <? $data = array( array('name'=>'Title 1','number'=>$intEnrolled) ,array('name'=>'Title 2','number'=>$intCompleted) ,array('name'=>'Title 3','number'=>$intExpired) ,array('name'=>'Title 4','number'=>$intProgress) ); foreach($data as $val){ echo $val['name'].' IS '. $val['number'].'<br/>'; } ?> try and you dont need the "" on your var.. Quote Link to comment Share on other sites More sharing options...
me1000 Posted March 3, 2008 Author Share Posted March 3, 2008 Thank You!! Quote Link to comment 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.