← All built-ins / intdiv()

intdiv()

intdiv(...$args): int

Parameters

NameTypeDescription
$aintdividend
$bintdivisor (must not be 0)

Return value

Integer division truncated toward zero.

Example

echo intdiv(7, 2), " ", intdiv(-7, 2);
3 -3

See also

fmod()floor()