0

I have a question. My array looks like this

Array (
  [27] => Array (
    [parent_id] => 26
    [name] => asd
    [item_id] => 27
  )
)

I want to echo the name but I don't know how, I have tried multiple foreaches and $array['name'], $array[1]['name'] but nothing works.

I hope someone can help me

1
  • 1
    echo $myArray[27]['name'] Commented May 26, 2013 at 10:18

3 Answers 3

1

$array[27]['name'] is ok try again

Sign up to request clarification or add additional context in comments.

Comments

0

Never mind, I have the solution it was $array[27]['name'].

Comments

0

You can also do

print_r($array[27]);

which will show the entire array.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.