How to compare two strings in version format? such that:
version_compare(\"2.5.1\", \"2.5.2\") => -1 (smaller) version_compare(\"2.5.2\", \"2.5.2\") =&
Also, you can use the PHP built-in function as below by passing an extra argument to the version_compare()
version_compare()
if(version_compare('2.5.2', '2.5.1', '>')) { print "First arg is greater than second arg"; }
Please see version_compare for further queries.