0

On using this in PHP

$datay1 = array_values($dataArray);

I get the output in the below form

Array ( [0] => 19 [1] => 17 [2] => 2 [3] => 18 [4] => 53 ) 

I want it to be converted to ("19,17,2,18,53"), taking in only the values and pass it to a function.

1
  • 6
    use implode() Commented Aug 27, 2014 at 7:27

3 Answers 3

4

use implode()

echo implode(',', $datay1);
Sign up to request clarification or add additional context in comments.

3 Comments

you are the first answered .
yeah thanks, all looks like given different answer rather than upvote same answer
@RakeshSharma Well... Mine was 2 seconds after... it takes some time to type in the answer ;)
1

Use the php function implode:

implode(',',$datay1);

Comments

0

Use Implode

echo implode(',', $datay1);

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.