I am developing a runtime intelligence software program. It collects the version number of programs so you can then see the statistics for each version number. The problem I am having with this is that some computers are sending the actual version number (ie: 0.4) and others are sending an erroneous version number (ie: 0.4.0). I was wondering if it would be OK if I used something like:
$version = rtrim($version, ".0");
Would this work to get rid of this problem or what this just cause more problems later on down the road?
This absolutely can cause problems.
rtrimstrips those characters if they appear at the end of the string in any order and possibly multiple times. So1.10will become1.1but these are not necessarily the same version.See it online: ideone