note 23386 added to function.settype
| From: | djworld@php.net | Date: | Wed, 17 Jul 2002 10:02:05 +0000 |
| Subject: | note 23386 added to function.settype | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33197@lists.php.net to get a copy of this message | ||
oliver AT mydalon DOT com: Usually it isn't necessary, but some times you need to be sure the
variables are of some kind. For example, if you send a number to a database query from a variable
passed by GET or POST, you may get sure it's a number by doing SetType ($var,
'integer'); so you can avoid security holes if it isn't a number and you don't
need to addslashes() it, or for example, if you need to be sure that a number won't have any
decimals after rounding it, you may do the same and as it will be an integer, it won't contain
decimals.
--
http://www.php.net/manual/en/function.settype.php
http://master.php.net/manage/user-notes.php?action=edit+23386
http://master.php.net/manage/user-notes.php?action=delete+23386
http://master.php.net/manage/user-notes.php?action=reject+23386