September 2001
Intermediate to advanced
768 pages
32h 45m
English
int intval(mixed value, [int base])
| value | Scalar value to convert to an integer |
| base | Specified base for the integer |
Converts a value to an integer.
Returns:
Integer of the specified base (10 if no base is specified)
Description:
intval() attempts to convert a single scalar value to an integer. Integers are whole numbers (such as 1, -2002, 34, 0, and so on).
If a base argument is provided and the value argument is a string, the value is considered to be of the base specified. See the notes and examples for more details.
The function can convert any normal numeric value, as well as numbers that are represented in scientific notation (such as 1.101e45), as a string (such as "1 cup of flour" or "10,000 keys for a single lock"), in octal ...
Read now
Unlock full access