Check if each element in an array is a positive, whole number, not a float
<p>To start, I'm still a noob with php, and much of what I've learned is from problems being solved across this site that I have also had myself.</p>

<p>I've found the answers here for all of my original questions, but when I put them all together I can't get get the code to work.</p>

<p>I have a basic form that is posting to itself using PHP_SELF. I want all input from the $_POST array to be checked to make sure that it is (1) a positive integer, (2) a whole number, and (3) does not include a decimal.</p>

<pre><code>if( !empty($_POST ) ) {
    foreach( $_POST as $key =&gt; $amount ) {
        if( !is_int($amount) || $amount &lt; 0 || is_float(amount) ) {
            die( 'All data must be positive integers.' );
        }
    }
}
</code></pre>

<p>No matter what I type into any of the input fields it always returns the "die" error.</p>
