function array2string($array){
$string = [];
if($array && is_array($array)){
foreach ($array as $key=> $value){
$string[] = $key.'->'.$value;
}
}
return implode(',',$string);
}
$array1= array('a', 'b', 'c', 'd');
echo $a = array2string($array1);