PHP - gmp_intval() Function
Definition and Usage
The gmp_intval() function converts GMP number to an integer.
Description
The gmp_intval() function converts the given number to an integer.
Syntax
gmp_intval ( GMP $gmpnumber ) : int
Parameters
| Sr.No | Parameter & Description |
|---|---|
| 1 |
gmpnumber It can a GMP resource number , a gmp object or a numeric string. |
Return Values
PHP gmp_intval() function returns a integer value for the given GMP number.
PHP Version
This function will work from PHP Version greater than 5.0.0.
Example 1
Working of gmp_intval −
<?php
$gmpint = gmp_intval('23123');
echo "The number is : ".$gmpint;
?>
This will produce following result −
The number is : 23123
Example 2
Working of gmp_init −
<?php
$gmpint = gmp_intval('231221474');
echo "The number is : ".$gmpint;
?>
This will produce following result −
The number is : 231221474
php_function_reference.htm
Advertisements