hi friends I have a php array for eg.

$mob_numbers= array(12345674, 12345675, 12345676,12345677);

I want to eacho out all of them at once so that it appears

12345674,12345675,12345676,12345677 (with comma) .

How do i do it ? I tried array explode, didn't work. Pls help

Accepted Answer

Just use implode function as:

echo implode(',',$mob_numbers);

explode is used to split a string to get an array

implode does the opposite of joining the array elements to get a string.

Written by codaddict
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki