Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php compare two versions return true or false if version is big

// Syntax 
version_compare(string $version1, string $version2, ?string $operator = null): int|bool
// operators are: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne

// Examples
version_compare('8.5.0', '8.0.0', '>='); // returns true
version_compare('8.5.0', '8.0.0', '<'); // returns false
 
PREVIOUS NEXT
Tagged: #php #compare #versions #return #true #false #version #big
ADD COMMENT
Topic
Name
4+6 =