RE: [PHP] || == != and =
| From: | John Coggeshall | Date: | Mon, 24 Jul 2000 18:56:34 +0000 |
| Subject: | RE: [PHP] || == != and = | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7832@lists.php.net to get a copy of this message | ||
Basic rundown:
$x = 5; // Assigns 5 to variable x
$x == 5; // Returns true if $x equals 5
$x != 5; // Returns true if $x not equal to 5
$x > 5; // Returns true if $x is greater than 5
$x < 5; // Returns true if $x is Less than 5
$x >= 5; // Returns true if $x is greater than or equal to 5
$x <= 5; // Returns true if $x is less than or equal to 5
($x != 5) || ($y == 3) // Returns true if $x does not equal 5 OR $y equals
3, or both
($x != 5) && ($y == 3) // Returns true if $x does not equal 5 AND $y equals
3
Those are the basic opreators... math ones are included as well (+ - * / %)
and function as expected (% is modulus, returns the remainder of a dirty
division)
Hope that helps.
John
-----Original Message-----
From: generic@iname.net [mailto:generic@iname.net]On Behalf Of Generic
Player
Sent: Sunday, July 23, 2000 11:57 PM
To: php-general@lists.php.net
Subject: [PHP] || == != and =
Newbie question I know, but I can't find this anywhere in the manual.
Where can I find out about what the various operators are and what they
do? All I know for sure is != means not equal. What's the difference
between == and =
And what does || do?
Thanks again
Generic Player
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net