Jump to content

[SOLVED] Simple array question


rhyspaterson

Recommended Posts

Hey guys,

 

Running some queries and get an array returned that looks like this:

 

Array ( [0] => Array ( [max] => 4 ) )

 

Just wondering how to access '4'. Been trying simple echo commands (echo $maxID; echo $maxID[0]; echo $maxID[1]; echo $maxID['max']; but cant get anything. Obviously its something stupid im not realizing, just need a shove in the right direction.

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/58638-solved-simple-array-question/
Share on other sites

Hey guys,

 

Running some queries and get an array returned that looks like this:

 

Array ( [0] => Array ( [max] => 4 ) )

 

Just wondering how to access '4'. Been trying simple echo commands (echo $maxID; echo $maxID[0]; echo $maxID[1]; echo $maxID['max']; but cant get anything. Obviously its something stupid im not realizing, just need a shove in the right direction.

 

Cheers

 

EDIT: echo $maxID[0]['max']; works, sorry :P

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.