I have a form with text fields that people fill in. How can I ensure that the value in each field is unique?
For example, if the user enters:
Email1 = joe@joe.com Email2 = bob@bob.com Email3 = sam@sam.com Email4 = bob@bob.com Email5 = ben@ben.com
How can I filter it out so that it shows only:
Email1 = joe@joe.com Email2 = bob@bob.com Email3 = sam@sam.com Email5 = ben@ben.com
One possibility:
$emails = array_unique( array( $_POST['email1'], $_POST['email2'], $_POST['email3'], $_POST['email4'], $_POST['email5'] ) );