I can't find a function that would check an array for redundancies!
Here's the situation:
On page A there is a form with several Select input fields, that all have the same group of option values.
The selected values get posted to page B as variables.
I need a way to check that eack selected value is unique, and there is no redundancy.
I can't use a single Multiple select field, because each value must have an associated quantity value that gets posted to page B also.
I though about this method:
$array1 = array($value2, $value3, $value4);
$array2 = array($value1, $value3, $value4);
----etc.----
then using in_array:
if (in_array($value1, $array1)) {
do something;
}
----etc.----
checking all arrays for the value that should be missing from that array if all values are unique.
If a redundancy is found, I'd like a warning that
says something like "valueX is selected more than once".
I guess this works, but does anyone know of a simpler method?