views:

27

answers:

3

how to i get to the arrays content if it doesnt have a key like this

$products[0] 

this will get me partially there but how to i get past []

( [0] => Array 
( [] => Array ( 
[0] => Array ( [product_name] => stuff i need to get to  ) 
A: 
$products[0][""][0]["product_name"]
Svisstack
+3  A: 

That is very strange. You could try

$products[0][''][0]['product_name']
BoltClock
Good idea. It's likely that the code generating this array has a typo or something that's setting the key to the empty string. Of course, you may also need to append `['product_name']` to this answer to get all the way to the 'stuff i need ...'
grossvogel
@grossvogel: oops, yeah I missed that out.
BoltClock
A: 

Use var_dump or var_export to print your array and you will see its an empty string. print_r will give you output like that for empty strings.

OIS