System:Bootstrap:versionCompare

From Aspen Documentation

Compared two version strings for similarity. This function removes all text and converts hyphens/dashes to decimal points. It then compares each integer separated by a period to it's relative value to the same position in the other version.

For example:

  • 1.0 is greater than 0.9.
  • 1.0.1 is less than 1.1.
  • 1.1 is equal to 1.1.0.

Since 1.0.1

Arguments

string versionCompare (string $build, string $match)

build
Your primary version number.
match
The version number you want to compare yours with.

Returns

Returns a string of "lesser", "equal", or "greater".

Examples

Example:

$this->APP->versionCompare('1.0.2', '1.0.1.25');

Returns:

"greater"