February 2013
Intermediate to advanced
538 pages
20h 55m
English
version_compare
mixed version_compare(stringone, stringtwo[, stringoperator])
Compares two version strings and returns −1 if one is less
than two, 0 if they are equal, and 1 if one is
greater than two. The version strings are
split into each numeric or string part, then compared as
string_value <
"dev" < "alpha" or "a" <
"beta" or "b" < "rc"
< numeric_value < "pl" or "p".
If operator is specified, the
operator is used to make a comparison between the version strings, and
the value of the comparison using that operator is returned. The
possible operators are < or
lt; <= or le; >
or gt; >= or ge; ==,
=, or eq; and !=, <>, and ne.
Read now
Unlock full access