variant_cmp
(PHP 5, PHP 7, PHP 8)
Compares two variants
Description
Compares left with right.
This function will only compare scalar values, not arrays or variant records.
Parameters
leftThe left operand.
rightThe right operand.
locale_idA valid Locale Identifier to use when comparing strings (this affects string collation).
flagsflagscan be one or more of the following values OR'd together, and affects string comparisons:value meaning NORM_IGNORECASECompare case insensitively NORM_IGNORENONSPACEIgnore nonspacing characters NORM_IGNORESYMBOLSIgnore symbols NORM_IGNOREWIDTHIgnore string width NORM_IGNOREKANATYPEIgnore Kana type NORM_IGNOREKASHIDAIgnore Arabic kashida characters
Variant-arith
Return Values
Returns one of the following:
| 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 |