First you would need to do a string compare vs numeric compare(ie,
eq vs == ).  If they can never enter the same response or value and you
don't care about capitalization, then you could use a hash and either
lower/upper case the input. If key exists and/or is defined, then would have
to respond with a different value.

Wags ;)

-----Original Message-----
From: twelveoaks [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 17:53
To: [EMAIL PROTECTED]
Subject: Matching strings


I have a series of variables, say, 
        $var0 $var1 $var2  $var3...  
up to lots and lots depending on user input.

They are also available as an array 
        @vars = (element1, element2,...)

I want to test to see if any two of their values are identical. Basically if
the user has made an entry that is not unique he should get an error
message.

I know how to compare any two of them of course

        if ($var1 == $var2)  { $youlose = "yes" }

but I don't want to do this over and over again. 
Is there a simple way to, say, compare multiple values to see if any two
within the group match?

Thanks,
Tara

Reply via email to