How can you compare two version numbers?
I don't want the simple 1.0.0.0 but I'm looking for comparing these
1.0.0.1
1.0.0.1rc1 / 1.0.0.1-rc1
1.0.0.1b
1.0.0.1a / 1.0.0.1-a
and so on
They are ordered in the direction of what is newest.
Quote from PHP.net from their function that does what I want
version_compare() compares two "PHP-standardized" version number strings. The function first replaces _, - and + with a dot . in the version strings and also inserts dots . before and after any non number so that for example '4.3.2RC1' becomes '4.3.2.RC.1'. Then it compares the parts starting from left to right. If a part contains special version strings these are handled in the following order: any string not found in this list < dev < alpha = a < beta = b < RC = rc < # < pl = p. This way not only versions with different levels like '4.1' and '4.1.2' can be compared but also any PHP specific version containing development state.
How can this be done?
Or is there something like this by default?