我确信这很简单......但我似乎无法弄明白.我需要向每个提到积分的电子邮件地址发送电子邮件.但这两封电子邮件都有36分.
$emails = $userTools->weeklyMail();
Run Code Online (Sandbox Code Playgroud)
print_r的:
Array
(
[0] => Array
(
[0] => email1@gmail.com
[1] =>
[2] => 36
)
[1] => Array
(
[0] => email2@gmail.com
[1] =>
[2] => 25
)
)
Run Code Online (Sandbox Code Playgroud)
环:
foreach($emails as $email)
{
$email = $email[0];
$subject = "You have ".$email[2]." points!!! !!!";
// The message
$message = "Hello\r\nYou have ".$email[2]." points .";
$helperClass->sendEmail($email, $subject, $message);
}
Run Code Online (Sandbox Code Playgroud) php ×1