I need to compare the two # versions to see if one of them is bigger than the other, and itβs really hard for me to do this.
version 1: test_V10.1.0.a.1@example version 2: test_V9.7.0_LS@example
I tried to remove all non-digital characters, so I would stay with:
version1: 10101 version2: 970
Which is βaβ from 10.1.0.a.1, so thatβs nothing good, and I tried to take everything between βtest_β and β@β, and then delete everything thatβs to the right of the underscore β_β, and the underscore itself but then I still need to cut "V" at the beginning of the line.
Even if I can only go to 10.1.0.a.1 and 9.7.0, how can I compare these two? How can I find out if 10.1.0.a.1 is greater than 9.7.0? If I delete the decimals, I still remain with the numeric character in 1010a1, but I need this character in case the release version I am comparing is 10.1.0.b.1, it will be more than 10.1.0 .a.1.
It drives me crazy, has anyone talked about this before? How did you compare the values? I am using php.
source
share