PHP Manual

PHP function strnatcmp()

2019-09-11T08:04:03.000Z

Obsah článku

Availability in PHP 4.0

String comparisons using a "natural order" algorithm

Parameters

Parameter Data type Default value Note
$str1 string not The first string.
$str2 string not The second string.

Return values

int

Similar to other string comparison functions, this one returns < 0 if
str1 is less than str2; >
0 if str1 is greater than
str2, and 0 if they are equal.

Other resources

Official strnatcmp documentation

Jan Barášek   Více o autorovi

Autor článku pracuje jako seniorní vývojář a software architekt v Praze. Navrhuje a spravuje velké webové aplikace, které znáte a používáte. Od roku 2009 nabral bohaté zkušenosti, které tímto webem předává dál.

Rád vám pomůžu:

Související články

1.
158.

V jiných jazycích

Status:
All systems normal.
2025