Javatpoint Logo
Javatpoint Logo

PHP gmp_intval() Function

The PHP GMP gmp_intval() function converts given parameters into integer value. The function's input data can be a string value, binary value, or GMP parameters value.

Syntax

The following syntax shows the PHP GMP intval function.

Parameters

  • The function takes one parameter, $numbers, which is a GMP number and shows its value as an integer.
  • In PHP versions 5.6 and later, this parameter can be a GMP object.
  • We can also pass a numeric string as long as it is possible to turn that string into a number.

Return Values

The function gets the integer value of the given GMP number $numbers.

Note

  • If a number string is passed as an integer, the same integer is returned (except above the PHP integer limit).
  • If a GMP number is given, the function shows the integer value of a GMP number.

Examples

The following example shows the converted integer value from several parameters using the GMP function.

Example1: the following example shows gmp_intval() function with basic value. The given parameter shows integer values of the various numbers.

Output:

The image shows the integer value of the given value.

PHP gmp_intval() Function

Example2: The below code shows how gmp_intval() works when given a GMP number with limits.

Output:

The image show gmp_intval() functions output value.

PHP gmp_intval() Function

Example3: The below code shows how gmp_intval() works when given a GMP number as an argument.

Output:

The image show gmp_intval() functions output value.

PHP gmp_intval() Function

Conclusion

The gmp_intval() function displays the integer value of the given string data. If the string value assigns a limit, the function easily shows integer data.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA