Voting

: max(one, nine)?
(Example: nine)

The Note You're Voting On

davide dot renzi at gmail dot com
9 years ago
I've found a faster way of determining an integer.
On my env, this method takes about half the time of using is_int().

Cast the value then check if it is identical to the original.

<?php
if ( (int) $n !== $n ) {
echo
'not is int';
} else {
echo
'is int';
}
?>

<< Back to user notes page

To Top