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 Quote Link to comment 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']; } Quote Link to comment Share on other sites More sharing options...
swamp Posted December 16, 2009 Author Share Posted December 16, 2009 Legend. Thanks. 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.