Divide integer and get integer value
In PHP 7, there is intdiv function doing exactly what you want.
Usage:
intdiv(8, 3);
Returns 2
.
use round()
function to get integer rounded value.
round(8 / 3); // 3
or
Use floor()
function to get integer value
floor(8 / 3); // 2