How to separate an array with commas in PHP
Separating an array with commas in PHP, we are separating an array with PHP’s function implode, first we are using an array of sample values and assigning it to an $array variable. then we are passing two arguments to implode function one is separator, what we want to separate the array with, ane the next one the array.
$array = array(‘hi’, ‘this’, ‘is’, ‘an’, ‘array’);
$comma_list = implode(‘, ‘, $array);