Thread: detect number
View Single Post
  #2  
Old 12-24-2006, 08:47 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Chompy View Post
Well, I've been searching and stuff, I only found the answer to check if the number contains decimals, well I want to check if the float/string is a number, not a string or anything, anyone have an example or can tell me how to detect if a string/variable is a number?
PHP Code:
if (float(var) == var) {
  
// we have a number.

__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote