如何在每封电子邮件中添加单引号或双引号添加示例
内爆后我的电子邮件应该是这样的
(red@yahoo.com, blue@yahoo.com, yellow@yahoo.com, white@yahoo.com)
将该数组字符串转换为:
('red@yahoo.com', 'blue@yahoo.com', 'yellow@yahoo.com', 'white@yahoo.com')
或者
("red@yahoo.com", "blue@yahoo.com", "yellow@yahoo.com", "white@yahoo.com")
$num = count($email);
for($i=0; $i < $num; $i++){
$result = do_post_request("http://api.myapi.com/api/IsActiveAccount?email=". $email[$i], null);
$status = str_replace('{"result":', "", $result);
$status = str_replace('}', "", $status);
$value_email[] = $email[$i] ;
$value_status[] = $status ;
}
$val_email = implode(',',$value_email);
$value_status = implode(',',$value_status);
define ("VERIFY_EMAIL_UPDATE_SENT", " UPDATE `accounts` SET sent = 1 WHERE email IN (".$val_email.") AND active <> 1");
$db->query(VERIFY_EMAIL_UPDATE_SENT);
echo 'Done';
Error because ---->email IN (red@yahoo.com, blue@yahoo.com, yellow@yahoo.com, white@yahoo.com)