var all_daihao = ['https://mp.weixin.qq.com/s/Il8dsit','https://mp.weixin.qq.com/s/X'] ;
PHP 將二維數組轉化成字符串
$sql2 = 'select gzurl from ims_dream_wx_wxgz where status =1 and '. 'groups=' .$groups ;
$result = $link->query($sql2);
$list2 = (mysqli_fetch_all($result,MYSQLI_ASSOC));
if(!$list2){
die('錯誤2');
}
foreach ($list2 as $val) {
$val = join(",",$val);
$temp_array[] = $val;
}
把PHP的數組變成帶單引號的字符串
$str = join(",",$temp_array);
$result = "'".str_replace(",","','",$str)."'";
//$result = implode(',', array_map('change_to_quotes', $temp_array ));
//
//function change_to_quotes($str) {
// return sprintf("'%s'", $str);
//}