I want to take integer input in PHP but the integer can be up to 10^12
<?php
$input = fopen('php://stdin', "r");
fscanf($input, "%d", $x);
print $x;
?>
The above code do not works for input after 10^10.How can we take this integer input?Here is the link
2^51, which is far, far more than the10^12you need. You can then do validation to ensure it's an integer value, etc.10^12 > 2^31. But if you have the 64-bit version of PHP then you're all set because10^12 ≪ 2^63