0

I have a result that looks like this when I do a print_r($array);

(
    [0] => 96
    [1] => 95
    [2] => 94
)
Array
(
    [0] => 96
    [1] => 95
    [2] => 94
)
Array
(
    [0] => 96
    [1] => 95
    [2] => 94
)

How can I simply return something like "96,95,94"? And not return all 3 duplicate instances?

Thanks

1
  • 4
    Either that's the output of three print_r() calls with the first one being strangely headless, or you're not pasting the real output. Commented Nov 2, 2010 at 4:07

1 Answer 1

1
print_r($array[0])

If you have 3 repeated Arrays just use the first one.

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

4 Comments

If I do that, I get 959595. :-(
@Scott please read @BoltClock's comment. If you have a multi-dimensional array (like tagged) and the result set is somewhat similar to what you pasted, you're good to go. Else you're calling print_r 3 times.
I checked and it's not doing print_r 3 times. argh. not sure what's going on.
Hmm. wait.. I think I am doing print_r 3 times. argh.

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.