Re: Stop Form Values Being Equal
Just an FYI, if you're expecting string values then you should use === for comparison. However in this case, array_unique() would be faster than making a function:
PHP Code:
if (count(array_unique($_POST['values'])) == count($_POST['values'])) {
//no matches
}
else {
//matches
}
But if you're expecting numeric data, then you'll have to use a function like the one xPlozion provided. This is because array_unique() checks if the values are *identical* as strings. So "1.0" wouldn't match "1".
"But you have access to the greatest source of knowledge in the universe."
"Well I do talk to myself sometimes, yes."
"I'm back, and I'm bad! Obviously within certain, sensible, preset parameters"