note 10765 added to Logical Operators
| From: | muerte at web-ster dot com | Date: | Sun, 21 Jan 2001 04:42:50 +0000 |
| Subject: | note 10765 added to Logical Operators | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-10028@lists.php.net to get a copy of this message | ||
The or operator does not function as specified above. At least not in PHP 4.0.3pl1. I'm
looking for an operator similar to the "default" operator in perl ||= but I have as of yet
been able to find one.
I was hoping to be able to do
$i = $i or "default value"
So if $i was set it would stay whatever it is, or if it was not set it would be assigned a default
value. This would be great for all the CGI variables that get sent into your pages.
But in the example I used above $i is always assigned the value of "" which doesn't
help me.
http://www.php.net/manual/en/language.operators.logical.php