
October 9th, 2012, 05:01 PM
|
|
Contributing User
|
|
Join Date: Aug 2009
Posts: 49
Time spent in forums: 5 h 34 m 35 sec
Reputation Power: 4
|
|
|
Multi Arrays While Loop Question?
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!
PHP Code:
$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>';
}
}
|