Zurev Posted January 3, 2011 Share Posted January 3, 2011 http://content.screencast.com/users/DeviousDan/folders/Jing/media/a563187c-93fe-4ec7-b496-41e50554b639/2011-01-02_2220.png As you can see, I print_r the results array and it has a key of aim, I then try to access the aim value on line 44 and as you can see, it's an undefined Index. I've officially forgotten all basics of PHP, any fresh eyes wanna give some insight? Thanks. Link to comment https://forums.phpfreaks.com/topic/223233-ive-lost-it-get-array-value/ Share on other sites More sharing options...
Anti-Moronic Posted January 3, 2011 Share Posted January 3, 2011 It's because actual location is here: $results[0]['aim']; Link to comment https://forums.phpfreaks.com/topic/223233-ive-lost-it-get-array-value/#findComment-1154075 Share on other sites More sharing options...
Zurev Posted January 3, 2011 Author Share Posted January 3, 2011 It's because actual location is here: $results[0]['aim']; /mostupsetfacepalmever Thanks. Link to comment https://forums.phpfreaks.com/topic/223233-ive-lost-it-get-array-value/#findComment-1154076 Share on other sites More sharing options...
Anti-Moronic Posted January 3, 2011 Share Posted January 3, 2011 It's because actual location is here: $results[0]['aim']; /mostupsetfacepalmever Thanks. Don't worry, done it many times. Just take a close look at the print_r result (or var_dump() which is better) and you will see the two arrays with specified indexes. This was simple but I'm sure you'll come up against a hugely ridiculous and complex array some other time. In those instances, analyzing the actual structure is key. Link to comment https://forums.phpfreaks.com/topic/223233-ive-lost-it-get-array-value/#findComment-1154077 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.