Hi Everyone, I'm not sure why when I loop through my array I'm getting numbers associated with items in my array. How would I get rid of those numbers? My syntax is below. Thanks! $newschannels = array('Local'=>array('ABC6 News','CBS Stations','Local Fox News','NBC News'), 'Regional'=>array('YES Network','NESN'), 'National'=>array('Fox News','CNN','MSNBC'), 'International'=>array('BBC News','France International','Ireland International')); foreach($newschannels as $channels => $data){ echo "$channels".'<br>'; foreach($data as $key => $value){ echo "Region: $key, Channel: $value".'<br>'; } } PHP:
Each array value has a key. This is needed to access that value. If you don't provide one, php will automatically number them. So bottom line is you can't get just rid of those numbers. The question is what do you want to display in the place where the $key is currently displayed.
What is Region: $key supposed to output? I don't see any region in here unless the Local, Regional, etc. is supposed to be a region.