1
我有一個foreach循環和5000用戶在我的網站 ,我想向他們發送電子郵件PHP的foreach然後每100次睡眠繼續
然後每隔10個成員的睡眠5秒繼續
$headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/plain; charset=iso-8859-1";
$headers[] = "From: Sender Name <[email protected]>";
$headers[] = "Bcc: JJ Chong <[email protected]>";
$headers[] = "Reply-To: Recipient Name <[email protected]>";
$headers[] = "Subject: {$subject}";
$headers[] = "X-Mailer: PHP/".phpversion();
$users = array('mohamed','ahmed');
foreach($users as $user){
mail($user, $subject, $email, implode("\r\n", $headers));
}
如何做
「每100次睡眠就會繼續」和「每10個成員」。所以你想要什麼??? – sergio