Jump to content

I've lost it - Get array value....


Zurev

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.