variant_idiv

(PHP 5, PHP 7)

variant_idivConverts variants to integers and then returns the result from dividing them

说明

variant_idiv ( mixed $left , mixed $right ) : mixed

Converts left and right to integer values, and then performs integer division.

参数

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()

返回值

Variant Integer Division Rules
If Then
Both expressions are of the string, date, character, boolean type Division and integer is returned
One expression is a string type and the other a character Division
One expression is numeric and the other is a string Division
Both expressions are numeric Division
Either expression is NULL NULL is returned
Both expressions are empty A com_exception with code DISP_E_DIVBYZERO is thrown

参见

相关文章
php ibm db2 函数 returns an array indexed by column name representing a row in a result setphp ibm db2 函数 returns an array indexed by both column name and position representing a row in a result setphp ibm db2 函数 requests the next result set from a stored procedurephp ibm db2 函数 returns the number of fields contained in a result setphp ibm db2 函数 returns a single column from a row in the result setphp ibm db2 函数 returns a result set listing the tables and associated privileges in a databasephp firebird/interbase 函数 fetch a result row from a query as an associative arrayphp maxdb 函数 returns result set metadata from a prepared statementphp mqseries 函数 returns the error message corresponding to a result code mqrc php oci8 函数 returns the next child statement resource from a parent statement resource that has oracle database 12c implicit result setsphp sqlite 函数 executes a query against a given database and returns a result handlephp date/time 函数 returns the timezone name from abbreviationphp com 函数 adds two variant values together and returns the resultphp com 函数 performs a bitwise and operation between two variantsphp com 函数 concatenates two variant values together and returns the resultphp com 函数 returns the result from dividing two variantsphp com 函数 converts variants to integers and then returns the result from dividing themphp com 函数 divides two variants and returns only the remainderphp com 函数 performs a logical disjunction on two variantsphp com 函数 returns the result of performing the power function with two variants
关注编程学问公众号