On 11-Jul-01 James Bartlett wrote:
> Hi,
>
> This might sound really simple but plz humour me :)
>
> How can I tell if two text variables are equal to one another?
>
> If I use..
>
> if($text1 = $text2)
> {
> echo "The variables are equal";
> }
> else
> {
> echo "The variables are not equal";
> }
>
> then the code in the else state is always printed even if I know for a fact
> that the variables are equal...
>
> Any suggestions?
>
if ($text1 == $text2)
if (0 == strcmp(text1, $text2))
RTM
http://www.php.net/manual/en/language.operators.assignment.php
http://www.php.net/manual/en/language.operators.comparison.php
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]