1

I have these code:

 $arr = array($check);

When I try to

 echo "<pre>"; 
 die(print_r($arr));

it gives me result in the Firebug

 <pre>Array
          (
            [0] => Array
             (
               [0] => 2
               [1] => 1
             )

           )

Now, I want an output that will give me '2,1'. How could I do that in PHP? Do I need to use implode?

1 Answer 1

6

Yes you need to implode:

echo implode(',', $check);

You don't need to put it inside an array:

$arr = array($check); // no need
Sign up to request clarification or add additional context in comments.

3 Comments

Outer array well tackled! Authority!!
@DOCASAREL it makes no sense to assign it in an array again
@DOCASAREL i don't really know what you want at the moment, but answere is exactly what op wants and also describes ops mistake.

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.