variant_add

(PHP 5)

variant_add"Adds" two variant values together and returns the result

說明

mixed variant_add ( mixed $left , mixed $right )

Adds left to right using the following rules (taken from the MSDN library), which correspond to those of Visual Basic:

Variant Addition Rules
If Then
Both expressions are of the string type Concatenation
One expression is a string type and the other a character Addition
One expression is numeric and the other is a string Addition
Both expressions are numeric Addition
Either expression is NULL NULL is returned
Both expressions are empty Integer subtype is returned

參數

left

The left operand.

right

The right operand.

Note:

對於所有變數運算函式,本函式的參數可以是 PHP 內建的類型(整數,字串,浮點數,布林值或者 NULL),或者是一個 COM,VARIANT 或者 DOTNET 類別的實體。PHP 內建類型將會使用和建構VARIANT類型相同的規則轉換成變數。COM 和 DOTNET 物件的值將會其預設屬性並被當成變數值使用。

變數運算函式是同名函式在 COM 函式庫中的外包;有關此類函式的更多訊息參見 MSDN 函式庫。PHP 函式命名有少許區別,例如 PHP 中的 variant_add() 對應於 MSDN 文件中的 VarAdd()

回傳值

Returns the result.

參見

  • variant_sub() - Subtracts the value of the right variant from the left variant value

add a note add a note

User Contributed Notes

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