$arr = array ( 0 => "lorem", 1 => "ipsum", 2 => "dolor");
$str = implode (", ", $arr);
$myString = "9,admin@example.com,8";
$myArray = explode(',', $myString);
print_r($myArray);
$tags = implode(', ', array('tag1','tag2','tag3','tag4'));
$string = implode(', ', $tags);
$string = "'1', '2', '3'";
$string = str_replace("'", '', $string);
$sql = "SELECT * FROM name WHERE id NOT IN ( " . implode(",", explode(',',$string)) . ") LIMIT 10 ";
echo $sql;
Array to comma separated string