note 14971 deleted from function.is-int by jimw

From: Date: Thu, 20 Dec 2001 23:34:46 +0000
Subject: note 14971 deleted from function.is-int by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-23578@lists.php.net to get a copy of this message
[Editor's note: this simply ALWAYS will be true, so is of no use. PHP will convert your var to a number, even if it is, let's say, "abc" --jeroen] This seems to work just fine for HTTP variables (params passed by GET/POST, which are always strings): if( is_int( $id * 1 ) ) echo "Valid"; else echo "Invalid;"; -Nick (http://www.nickbouton.com/)

« previous php.notes (#23578) next »