如何将数组转换成键值对字符串
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);