note 67429 added to language.types.boolean
| From: | jasperatjteydotcom at osu1 dot php dot net | Date: | Wed, 07 Jun 2006 21:16:35 +0000 |
| Subject: | note 67429 added to language.types.boolean | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-113671@lists.php.net to get a copy of this message | ||
A correction to my previous note below, with regards to the following code snippet:
<?php
// lower case vowel check (incorrect)
$c = "u";
$isVowel = $c == "a"||"e"||"i"||"o"||"u";
?>
The portion containing '$c ==
"a"||"e"||"i"||"o"||"u"' should be '$c
== "a"|| $c == "e"|| $c == "i"|| $c == "o"|| $c ==
"u"' instead. The correct code is therefore:
<?php
// lower case vowel check (corrected)
$c = "u";
$isVowel = $c == "a"|| $c == "e"|| $c == "i"|| $c == "o"||
$c == "u";
?>
----
Server IP: 66.207.199.35
Probable Submitter: 69.159.216.64
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/language.types.boolean.php
Edit -- http://master.php.net/note/edit/67429
Del: integrated -- http://master.php.net/note/delete/67429/integrated
Del: useless -- http://master.php.net/note/delete/67429/useless
Del: bad code -- http://master.php.net/note/delete/67429/bad+code
Del: spam -- http://master.php.net/note/delete/67429/spam
Del: non-english -- http://master.php.net/note/delete/67429/non-english
Del: in docs -- http://master.php.net/note/delete/67429/in+docs
Del: other reasons-- http://master.php.net/note/delete/67429
Reject -- http://master.php.net/note/reject/67429
Search -- http://master.php.net/manage/user-notes.php