thanks, i will look it over. but to clear it up. I have: say "blue" "green" "orange" in an array I want: $variable to equal blue, green, orange
Are you sure you're echoing the new variable instead of the array? The function outputs a string, not an array.
foreach($array as $v) { $string .= $v . ","; } PHP: that'll do it ..... $string now contains array1,array2,array2
No point is iterating through it, just use implode() like you suggested earlier.. <?php $colorArray = array("blue", "green", "red"); $colors = implode(",", $colorArray); // Outputs: blue,green,red echo $colors; ?> PHP:
I've used the same function for the same purpose over and over. The only reason it wouldn't work would be an easy to fix oversight.
thanks all... for some reason, I had saved it the correct way, then ctrl+z (accident) and i guess saved it again. so it didn't work.