Odd is_int() behaviour
| From: | Ashley M. Kirchner | Date: | Sun, 21 Oct 2001 09:55:47 +0000 |
| Subject: | Odd is_int() behaviour | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-71733@lists.php.net to get a copy of this message | ||
I have the following snippet in my file:
if ($PATH_INFO == "") { $PATH_INFO = "/"; }
echo "PATH_INFO: $PATH_INFO<br>\n";
// All we want is the fist element, call it $section
list($section) = explode('/', substr($PATH_INFO,1));
if (is_int($section)) {
echo "section: $section<br>\n";
} else {
echo "Invalid section (NON_INT: $section)<br>\n";
}
Um, why does it fail when I hit the script with any INT?
For example: /script/1 fails. Is $section not an INT when parsed?
--
H | "Life is the art of drawing without an eraser." - John Gardner
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:ashley@pcraft.com> .
303.442.6410 x130
Director of Internet Operations / SysAdmin . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave, #6
http://www.pcraft.com ..... . . . Boulder, CO 80303,
U.S.A.