I'm more of a front-end dev and I'm not very far with PHP. I mostly use jquery and reactjs for my applications. I'm creative when it comes to design, but I got barely any inspiration while writing something functional. I need a way to send for each unique e-mail from an array, a random key from another array to that email, but so that each email get's an unique key.
That doesn't sound difficult. Try something like this.
$emails = ["first@example.com", "second@example.com"];
$uniqueEmails = array_unique($emails);
$uniqueKeys = ["uniq1", "uniq2"];
foreach ($uniqueEmails as $key => $email) {
//TODO: sendMail($email, $key);
}
The array_unique() function is used to remove duplicates from your array.
As far as I understand your question, you want to send the unique key to that email address. The PHP mail function can do that for you: http://php.net/manual/en/function.mail.php.