array to string separated by comma php

PHP
$arr = array ( 0 => "lorem", 1 => "ipsum", 2 => "dolor");

$str = implode (", ", $arr); $tags = implode(', ', array('tag1','tag2','tag3','tag4'));$string = implode(', ', $tags);
Source

Also in PHP: