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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.