note 83090 added to tutorial.useful
| From: | tomcraig_fmu at yahoo dot com | Date: | Fri, 09 May 2008 13:25:58 +0000 |
| Subject: | note 83090 added to tutorial.useful | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139216@lists.php.net to get a copy of this message | ||
As an instructor of computer languages, I think your use of a double negative is a poor choice and
bad example. Here is how I would code your example:
<?php
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') == TRUE)
{
echo 'You are using Internet Explorer.<br />';
}
?>
Now instead of saying something "if something is not FALSE", you are saying if
"something is TRUE". Having programmed for over 30 years, I have found this much easier
to code, debug and pass on to future programmers.
----
Server IP: 209.41.74.194
Probable Submitter: 192.193.221.142
----
Manual Page -- http://www.php.net/manual/en/tutorial.useful.php
Edit -- https://master.php.net/note/edit/83090
Del: integrated -- https://master.php.net/note/delete/83090/integrated
Del: useless -- https://master.php.net/note/delete/83090/useless
Del: bad code -- https://master.php.net/note/delete/83090/bad+code
Del: spam -- https://master.php.net/note/delete/83090/spam
Del: non-english -- https://master.php.net/note/delete/83090/non-english
Del: in docs -- https://master.php.net/note/delete/83090/in+docs
Del: other reasons-- https://master.php.net/note/delete/83090
Reject -- https://master.php.net/note/reject/83090
Search -- https://master.php.net/manage/user-notes.php