Re: [PHP] check for a number

2002-09-04 Thread Erwin
Steve Bradwell wrote: > is_int($f) will return true if $f is an integer, false otherwise. is_int will return false in this case, because it's a string. You have to use is_numeric HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] check for a number

2002-09-04 Thread Chris Boget
> I am using > substr("$f", 0, 1); > to get the first character of a string but what to be able to tell if > the first character is a digit or a letter is there a way to do this? ereg( "^[0-9]", $f ) will let you know if the first character is a digit or not... Chris -- PHP General Maili

RE: [PHP] check for a number

2002-09-04 Thread Steve Bradwell
is_int($f) will return true if $f is an integer, false otherwise. Check http://www.php.net/manual/en/function.is-int.php HTH, Steve. -Original Message- From: Fifield, Mike [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 4:04 PM To: [EMAIL PROTECTED] Subject: [PHP] check f