PHP code example of cubedtear / semver

1. Go to this page and download the library: Download cubedtear/semver library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cubedtear / semver example snippets


use Cubedtear\Semver\Version;

$v1 = Version::parse("0.1.1");
$v2 = Version::parse("0.1.1-alpha");
$v3 = Version::parse("1.0.12-beta+ff12b4d8");

if (Version::compare($v1, $v2)) {
    ...
}

if (Version::compare("0.1.1", "0.1.0")) {
    ...
}