hello,
I have a script where, if the user recommend the website to his friends I send them an email.
it works just fine BUT: if the "friend" is already registered on the website the email is still sent to him...
so I got this code:
$array = array( array("$email1", "$sendmail1"),
array("$email2", "$sendmail2"),
array("$email3", "$sendmail3"),
array("$email4", "$sendmail4"),
array("$email5", "$sendmail5")
);
foreach($array as $key=>$value)
{
foreach($value as $subkey=>$subvalue)
{
if(isset($subvalue))
{
$swift->send($message, "$value", "admin@mydomain.com");
}
}
}
what I am trying to do here:
read the array
$value = email address
$subvalue = the value of sendmail (if set: value = 1)
for each email, check the value of sendmail (called $subvalue)
if $subvalue exists in the array, use the email in the script.
the thing is: it doesnt work...
can anybody give me a hand on this please?
thanks!