Solved

php check whole number

Posted on 2006-11-08
3
1,115 Views
Last Modified: 2012-05-05
how do I check to see if a number is a whole number and not a decimal?
0
Comment
Question by:jackjohnson44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Expert Comment

by:JonathanMT
ID: 17902208
0
 
LVL 2

Accepted Solution

by:
JonathanMT earned 500 total points
ID: 17902221
or to check for input from a form etc. (where the var type will be a string) : http://uk2.php.net/manual/en/function.is-numeric.php#69366
0
 

Author Comment

by:jackjohnson44
ID: 17902255
your first comment didn't work
I found the answer

            if(is_numeric($order_quantity))
                  {
                  if ( ((int)$order_quantity) != ((float)$order_quantity) )
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question