Checking for duplicate values
Posted: Sat Mar 03, 2007 7:35 am
I have 4 values that are being submitted from a form, but I need to check if all these values are unique.
Say these are our four values:
Which is the best way to go about checking no two values are the same?
I was thinking about putting the values in an array and then checking each value doesn't appear twice, I'm just not sure how to approach it.
Could anybody recommend anything?
Say these are our four values:
Code: Select all
$battle1 = $_POST['battle1'];
$battle2 = $_POST['battle2'];
$battle3 = $_POST['battle3'];
$battle4 = $_POST['battle4'];I was thinking about putting the values in an array and then checking each value doesn't appear twice, I'm just not sure how to approach it.
Could anybody recommend anything?