PHP code example of arkuuu / semantic-version

1. Go to this page and download the library: Download arkuuu/semantic-version 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/ */

    

arkuuu / semantic-version example snippets


$currentVersion = new Version('1.0.17');
$minimalVersion = new Version('1.0');
$versionOk = $currentVersion->isGreaterOrEqual($minimalVersion);
// $versionOk will be "true"


$versionA = new Version('1.0.17');
$versionB = new Version('1.0.25');
$sameVersions = $versionA->isSame($versionB);
// $sameVersions will be "false"