There is foreach loop in php. You have to traverse the array.
foreach($array as $key => $value)
{
echo $key." has the value". $value;
}
If you simply want to add commas between values, consider using implode
$string=implode(",",$array);
echo $string;
More Related Contents:
- PHP – File to Associative Array with 1 key and two values attached
- In PHP, how do you change the key of an array element?
- Convert backslash-delimited string into an associative array
- Is there a way to find out how “deep” a PHP array is?
- Replace keys in an array based on another lookup/mapping array
- Associative array, sum values of the same key
- How to sort a date array in PHP
- Convert an associative array to a simple array of its values in php
- PHP combine two associative arrays into one array
- Comment associative array in PHP Documentor
- PHP – Merge two arrays (same-length) into one associative?
- Flip associative array and store new values in subarrays to prevent losing duplicated values
- Merge multiple associative arrays and add missing columns with a default value
- Iterating over a complex Associative Array in PHP
- Generate an associative array from an array of rows using one column as keys and another column as values
- Group rows in an associative array of associative arrays by column value and preserve the original first level keys
- Prepend associative array elements to an associative array
- Custom key-sort a flat associative based on another array
- Merge two numerically-keyed associative arrays and preserve the original keys
- PHP/SQL Insert Error when using Named Placeholders
- Implementing a simple lookup array
- Conditionally add associative element to array
- array_diff to compare two associative arrays
- How to remove duplicate values from a multi-dimensional array in PHP
- Convert multidimensional array into single array
- create array tree from array list
- php return only duplicated entries from an array
- Create an assoc array with equal keys and values from a regular array
- PHP get both array value and array key
- Remove item from array if it exists in a ‘disallowed words’ array