gmp_export
(PHP 5 >= 5.6.1, PHP 7, PHP 8)
gmp_export — Export to a binary string
Description
Exports a GMP number to a binary string. This function can handle
arbitrarily large numbers beyond the range of PHP's native integer
type, with configurable word size and byte order, similar in spirit
to pack().
The sign of the number is ignored; exporting a negative number
produces the same result as exporting its absolute value.
Return Values
Returns a string containing the binary representation of the
GMP number. The string is empty if the number is zero.
Examples
Example #1 gmp_export() example
<?php
$number = gmp_init(16705);
echo gmp_export($number) . "\n";
?>
The above example will output: