note 23386 deleted from function.settype by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 12:19:50 +0000 |
| Subject: | note 23386 deleted from function.settype by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197194@lists.php.net to get a copy of this message | ||
Note Submitter: djworld at php dot net
----
Usually it won't be necessary to use this function, 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.
(ed: change to reflect deleted of other notes)