toInt.php
Table of Contents
Functions
- toInt() : int
- Converts a value to an integer, defaulting to zero.
Functions
toInt()
Converts a value to an integer, defaulting to zero.
toInt(mixed $value) : int
- Returns
$valueunchanged if it is already anint. - Casts any other numeric value (numeric string, float, ...) to
int. - Returns
0for anything non-numeric.
Parameters
- $value : mixed
-
The value to convert.
Tags
Return values
int —The integer value of $value, or 0 if it can't be resolved to a number.