I've been looking into this problem for a couple of days now and I just can't seem to figure it out.
I'm trying to do something simple, I thought, just looping through an array. This is a screenshot of the array: http://cl.ly/image/3j2J3x1C3B0j I'm trying to loop through all the 'Skills' array, there the "Skill' array and inside that grabbing the "Icon". For this I made 2 loops:
foreach ($hero_data['skills'] as $skills)
{
foreach ($skills as $skill)
{
//print_r($skill['skill']);
}
}
Unfortunaly this doesn't work, in laravel. I'm getting the "Undefined index: skill" error. It does work when I tried it outside , as a standalone script.
Out side both of the loops I can select the icon with:
print_r($hero_data['skills']['active'][0]['skill']['icon']);
I'm sure I'm overlooking something stupid...
Thanks a lot for the help,
$hero_dataarray? You are probably looping over elements that don't have the required keys but they aren't visible in your screenshot.