So far i have two answers which come with drawbacks however: 1. Run the number through a regexp and check for a period. This seems a bit hackish and overblown to me though. As shown in the answers by zwon and kyle this method is completely unusable due to unexpected traps.
2. Compare $number and int($number). This is a bit nicer, but requires a bit more work, code-wise.