www.webdeveloper.com
Results 1 to 4 of 4

Thread: [RESOLVED] PHP equivalent of isNaN

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    53

    resolved [RESOLVED] PHP equivalent of isNaN

    Is there a PHP equivalent of isNaN in Javascript? If not, is there some way to check if a form contains only numbers with PHP?

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,523
    is_numeric(), perhaps?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Aug 2009
    Posts
    53
    Yep, that's it. Thanks.

  4. #4
    Join Date
    Nov 2008
    Posts
    2,477
    Just for reference, PHP also has is_nan, though if you're dealing with forms you;ll want to use is_numeric as it works with string representations of numbers.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles