(PHP 5, PHP 7, PHP 8)
variant_cmp — Compares two variants
$left
,$right
,$locale_id
= LOCALE_SYSTEM_DEFAULT
,$flags
= 0
Compares left
with right
.
This function will only compare scalar values, not arrays or variant records.
left
The left operand.
right
The right operand.
locale_id
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:
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 |
注意:
對于所有變量運(yùn)算函數(shù),本函數(shù)的參數(shù)可以是 PHP 內(nèi)置的類型(整數(shù),字符串,浮點(diǎn)數(shù),布爾型或者
null
),或者是一個(gè) COM,VARIANT 或者 DOTNET 類的實(shí)例。PHP 內(nèi)置類型將會(huì)使用和構(gòu)造variant類相同的規(guī)則轉(zhuǎn)換成變量。COM 和 DOTNET 對象的值將會(huì)取其默認(rèn)屬性并被當(dāng)成變量值使用。變量運(yùn)算函數(shù)是同名函數(shù)在 COM 庫中的外包;有關(guān)此類函數(shù)的更多信息參見 MSDN 庫。PHP 函數(shù)命名有少許區(qū)別,例如 PHP 中的 variant_add() 對應(yīng)于 MSDN 文檔中的
VarAdd()
。
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
|