swamp Posted December 16, 2009 Share Posted December 16, 2009 Hi guys, I've got this array: Array ( [0] => Array ( [block_id] => 1 [template_file] => textpanel.php ) [1] => Array ( [block_id] => 2 [template_file] => textpanel.php ) ) I'm struggling to get to template_file from a foreach loop I have this: $data = $resultset->fetchAll(); foreach ($data as $item){ echo $item->template_file } Any help is much appreciated, I think I'm just missing something in between $item-> and template_file but not sure what. Thanks Link to comment https://forums.phpfreaks.com/topic/185360-array-help/ Share on other sites More sharing options...
rajivgonsalves Posted December 16, 2009 Share Posted December 16, 2009 if thats a print_r of your $data it should be $data = $resultset->fetchAll(); foreach ($data as $item){ echo $item['template_file']; } Link to comment https://forums.phpfreaks.com/topic/185360-array-help/#findComment-978521 Share on other sites More sharing options...
swamp Posted December 16, 2009 Author Share Posted December 16, 2009 Legend. Thanks. Link to comment https://forums.phpfreaks.com/topic/185360-array-help/#findComment-978525 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.