anjandas Posted September 17, 2015 Share Posted September 17, 2015 I have a problem in array..My Array look like this Array ( [2015] => Array ( [0] => Array ( [file] => A-15-09-15_web.pdf [documentname] => Hazlet Township Committee Meeting Minutes 9-15-2015 [date] => 2015 ) [1] => Array ( [file] => A-15-09-01.doc_web.pdf [documentname] => Hazlet Township Committee Meeting Minutes 9-1-2015 [date] => 2015 ) [2] => Array ( [file] => A-15-08-18.doc_web.pdf [documentname] => Hazlet Township Committee Meeting Minutes 8-18-2015 [date] => 2015 ) ) [2014] => Array ( [0] => Array ( [file] => A-14-12-16_web.pdf [documentname] => Hazlet Township Committee Meeting Minutes 12-16-2014 [date] => 2014 ) [1] => Array ( [file] => A-14-12-02_web.pdf [documentname] => Hazlet Township Committee Meeting Minutes 12-2-2014 [date] => 2014 ) ) ) but can u tell me how can I display like this.. Year 2015 Hazlet Township Committee Meeting Minutes 9-15-2015 Hazlet Township Committee Meeting Minutes 9-1-2015 etc etc Year 2014 Hazlet Township Committee Meeting Minutes 12-16-2014 Hazlet Township Committee Meeting Minutes 12-2-2014 Please help Quote Link to comment https://forums.phpfreaks.com/topic/298200-array-help/ Share on other sites More sharing options...
Solution Barand Posted September 17, 2015 Solution Share Posted September 17, 2015 foreach ($myarray as $yr => $yrdata) { echo $yr . '<br>'; foreach ($yrdata as $doc) { echo $doc['documentname'] . '<br>'; } } Quote Link to comment https://forums.phpfreaks.com/topic/298200-array-help/#findComment-1521042 Share on other sites More sharing options...
anjandas Posted September 17, 2015 Author Share Posted September 17, 2015 Great this is working.. Thank you Guru Quote Link to comment https://forums.phpfreaks.com/topic/298200-array-help/#findComment-1521049 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.