1

print_r($array) results
I retrieved some values from database and got the following result while using print_r:

Array
(
    [122] => Array
        (
            [p_name] => Tony Hutson
            [p_image] => profile_image/profile_61323166474.jpg
            [pid] => 42
            [sid] => 122
            [stitle] => sfcxdggf
            [audio] => audio_file/audio_61324302202.mp3
            [s_description] => ?mnlmkl bvnbmnmmn, bnbmn 
            [s_image] => sermon_image/image_41324302202.jpg
        )

    [count] => Array
        (
            [count] => 2
        )
)

How can I retrieve the value of count?

1
  • var_export produces valid PHP, which is more useful than the output of print_r. Commented Dec 28, 2011 at 6:16

2 Answers 2

5
echo $array['count']['count'];
Sign up to request clarification or add additional context in comments.

Comments

1

Like this,

echo $array['count']['count'];

1 Comment

The person (profile here), who answered this question one minute before you, giving exact same (identical) code as solution. That person deleted his/her answer some minutes after that, you left your answer and now you corrected it. Thanks for correction and good luck!

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.