soma56 Posted June 16, 2010 Share Posted June 16, 2010 I've figure out how to echo my array: <?PHP foreach(array_unique($matches[0]) as $type) { echo $type . "<br />"; } ?> But my problem is exporting to csv. From what I've been reading you must first implode the array and then use the fputcsv function. When I attempt to implode I simply get the word "Array" <?PHP $array = array("$matches"); $comma_separated = implode(",", $array); echo $comma_separated; ?> Link to comment https://forums.phpfreaks.com/topic/204912-imploding-array/ Share on other sites More sharing options...
Alex Posted June 16, 2010 Share Posted June 16, 2010 From your foreach it looks like this is what you want: $comma_separated = implode(",", $matches[0]); echo $comma_separated; Link to comment https://forums.phpfreaks.com/topic/204912-imploding-array/#findComment-1072777 Share on other sites More sharing options...
soma56 Posted June 16, 2010 Author Share Posted June 16, 2010 Thanks Alex, that was it. Link to comment https://forums.phpfreaks.com/topic/204912-imploding-array/#findComment-1072786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.