update : 2015.11.03
php.shukuma.com검색:
|
version_compare(PHP 4 >= 4.1.0, PHP 5, PHP 7) version_compare — Compares two "PHP-standardized" version number strings 설명version_compare() compares two "PHP-standardized" version number strings. The function first replaces _, - and + with a dot . in the version strings and also inserts dots . before and after any non number so that for example '4.3.2RC1' becomes '4.3.2.RC.1'. Then it compares the parts starting from left to right. If a part contains special version strings these are handled in the following order: any string not found in this list < dev < alpha = a < beta = b < RC = rc < # < pl = p. This way not only versions with different levels like '4.1' and '4.1.2' can be compared but also any PHP specific version containing development state. 인수
반환값By default, version_compare() returns -1 if the first version is lower than the second, 0 if they are equal, and 1 if the second is lower.
When using the optional 예제
The examples below use the
Example #1 version_compare() examples
<?php 주의
참고
|