Use the implode
function.
For example:
$fruits = array('apples', 'pears', 'bananas');
echo implode(',', $fruits);
More Related Contents:
- Array Comparision with a string PHP
- Split a comma-delimited string into an array?
- Remove empty array elements
- Parse query string into an array
- Array to String PHP?
- How create an array from the output of an array printed with print_r?
- Convert backslash-delimited string into an associative array
- Convert a comma-delimited string into array of integers?
- Convert flat array to a delimited string to be saved in the database
- String with array structure to Array [duplicate]
- php implode (101) with quotes
- use strings to access (potentially large) multidimensional arrays
- How to split a long string without breaking words?
- String contains any items in an array (case insensitive)
- Convert a String into an Array of Characters
- How to cast array elements to strings in PHP?
- PHP: Split string into array, like explode with no delimiter
- Search and replace multiple values with multiple/different values in PHP5?
- Explode string into array with no empty elements?
- Fastest way of deleting a value in a comma separated list
- PHP get values from SimpleXMLElement array
- How to implode array with key and value without foreach in PHP
- How to convert array values to lowercase in PHP?
- Convert a String to Variable
- Search and replace multiple values with multiple/different values in PHP?
- Check if string contains word in array [duplicate]
- PHP: Access Array Value on the Fly
- Unsetting array values in a foreach loop [duplicate]
- PHP – Find parent key of array
- Warning: array_combine(): Both parameters should have an equal number of elements