Re: Variables

From: Date: Wed, 11 Jul 2001 02:21:40 +0000
Subject: Re: Variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-57288@lists.php.net to get a copy of this message
Same as with two numerical values... use the == operator if($text1 == $text2) /* only true if the 2 vars are equal */ if($text1 = $text2) /* this sets $text1 to the same value as text2 and is always true unless $text2 = false */ http://php.net/manual/en/language.operators.comparison.php ----- Original Message ----- From: "James Bartlett" <zotud@btinternet.com> To: <php-general@lists.php.net> Sent: Tuesday, July 10, 2001 7:12 PM Subject: [PHP] Variables 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? James

« previous php.general (#57288) next »