Jump to content

Imploding Array


soma56

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.