ok this is kind of a strange one >>
..I'm trying to check to see if a string is a integer however the string has a calculation that makes it an integer, e.g.
..now every number with 2 decimal points should fit this condition and perform the given action however numbers 1.09-1.15 (2dp) do not unexplicably.. so that has led me to the 'is_int' function but...PHP Code:for ($d=1; $d<=100; $d++) {
if(($num*$d)==(int)($num*$d)) {
// perform action
break;
}
}
.. as you can see this doesn't work when a string is a calculation so I'm a little stuck on this and therefore call upon the good people of this forum <<PHP Code:$ex = (1.05*100);
if(is_int($ex)) {
echo "yes it is";
} else {
echo "no you don't!";
}
_thanks to all







Bookmarks