note 10765 rejected and deleted from Logical Operators by zak
| From: | zak@php.net | Date: | Sun, 21 Jan 2001 04:45:58 +0000 |
| Subject: | note 10765 rejected and deleted from Logical Operators by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-10029@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.