Re:An integer?

From: Date: Mon, 21 Aug 2000 13:46:44 +0000
Subject: Re:An integer?
Groups: php.general 
Request: Send a blank email to php-general+get-12747@lists.php.net to get a copy of this message
assign $variable to some $temp and check against it after settype? Shaun <delius@progsoc.uts.edu.au> wrote: > >This may be a silly question, but I can't spot and easy way to do it, I >want to check if the value inside a vriable is an integer. If I do >is_int($variable) I always get false, because this variable qwas read in >from a form so its a string, if I make the variable an integer using >settype() I just end up with 0 if it was invalid, the number otherwise. I >need something that will actually tell me if there the conversion was >successfull. Am I missing something? > >Thanks, >Shaun > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- //let your mind go, and your code will follow

« previous php.general (#12747) next »