Reputation: 231
I have got an array with variable number of strings.
I need to write each element, separated with comma as one string in a variable.
With "foreach()" I got every element in a separate line.
Upvotes: 0
Views: 99
Reputation: 1018
Use the snippet below:
implode(',', $array);
php.net-Docs
Upvotes: 4