The intval() function is an inbuilt function in PHP which returns the integer value of a variable.
Syntax:
int intval ( $var, $base )
Parameters: This function accepts two parameters out of which one is mandatory while the other one is optional. Parameters are described below: