variant_cmp

(PHP 5, PHP 7)

variant_cmpCompares two variants

Opis

variant_cmp ( mixed $left , mixed $right [, int $lcid [, int $flags ]] ) : int

Compares left with right.

This function will only compare scalar values, not arrays or variant records.

Parametry

left

The left operand.

right

The right operand.

lcid

A valid Locale Identifier to use when comparing strings (this affects string collation).

flags

flags can be one or more of the following values OR'd together, and affects string comparisons:

Variant Comparision Flags
value meaning
NORM_IGNORECASE Compare case insensitively
NORM_IGNORENONSPACE Ignore nonspacing characters
NORM_IGNORESYMBOLS Ignore symbols
NORM_IGNOREWIDTH Ignore string width
NORM_IGNOREKANATYPE Ignore Kana type
NORM_IGNOREKASHIDA Ignore Arabic kashida characters

Informacja:

Wszystkie arytmetyczne funkcje wariantowe przyjmują jako parametry albo rdzenne typy PHP (integer, string, floating point, boolean lub NULL), albo instancje klas COM, VARINAT lub DOTNET. Rdzenne typy PHP są konwertowane do wariantowych przy użyciu tych samych reguł, które znajdują się w klasie konstruktora variant. Obiekty COM i DOTNET powinny mieć wartości swoich domyślnych właściwości pobierane i używane jako wartości wariantowe.

Arytmetyczne funkcje wariantowe są nakładkami na podobnie nazwane funkcje w bibliotece COM; aby uzyskac więcej informacji o tych funkcjach odwiedź witrynę biblioteki MSDN. Funkcje PHP są nazwane nieco inaczej. Na przykład funkcji variant_add() w PHP odpowiada VarAdd() w dokumentacji MSDN.

Zwracane wartości

Returns one of the following:

Variant Comparision Results
value meaning
VARCMP_LT left is less than right
VARCMP_EQ left is equal to right
VARCMP_GT left is greater than right
VARCMP_NULL Either left, right or both are NULL

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top