PHP intdiv() Function

❮ PHP Math Reference

Example

Perform some integer divisions:

<?php
echo intdiv(8, 4) . "<br>";
echo intdiv(5, 2) . "<br>";
echo intdiv(-5, -2);
?>
Try it Yourself »

Definition and Usage

The intdiv() function is used for integer division.


Syntax

intdiv(dividend, divisor);

Parameter Values

Parameter Description
dividend Required. Specifies a number that will be divided
divisor Required. Specifies the number to divide the dividend by

Technical Details

Return Value: The integer part of the division
Return Type: Integer
PHP Version: 7+

❮ PHP Math Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.