Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

php
integer
communitycreator

What is gmp_intval in PHP?

Hammad Nasir

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

gmp_intval is a function in PHP that converts an argument to an integer.

Syntax

gmp_intval(GMP|int|string $num): int

Parameters

The function takes in one parameter, num.

num can be a numeric string, GMPGNU Multiple Precision Arithmetic Library object, or of type int.

Return value

The function returns an integer value of num.

Code

<?php
$val = gmp_intval("2147") . "\n";
echo gmp_strval($x) . "\n";
?>

Expected output

2147

RELATED TAGS

php
integer
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring