Tuesday, November 19, 2024
Google search engine
HomeLanguagesPHP | gmp_export() function

PHP | gmp_export() function

The gmp_export() function is an inbuilt function in PHP which exports a GMP number(GNU Multiple Precision: For Large Numbers) to a binary string.

Syntax: 

string gmp_export ( GMP $gmpnumber, int $word_size, int $options )


Parameters: The gmp_export() function accepts three parameters as shown above and described below: 

  • $gmpnumber: This is a required parameter of gmp_export() function, it is the number to be exported by the function.
  • $word_size: This parameter contains the number of bytes in each chunk of binary data. This parameter is mainly used simultaneously with the options parameter. The default value of this parameter is 1.
  • $options: This parameter has default value of GMP_MSW_FIRST | GMP_NATIVE_INDIAN.

Return Value: The function returns a string on success and FALSE on failure.

Below program illustrate the gmp_export() function in PHP: 

PHP




<?php
// PHP code implementing the gmp_export function
 
// The gmp_init() function creates a gmp number
// form a string or number
$number = gmp_init(16705);
 
echo gmp_export($number) . "\n";
 
?>


Output: 

 AA


Related Articles: 

Reference: http://php.net/manual/en/function.gmp-export.php
 

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments