array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'function.gmp-export.php', 1 => 'gmp_export', ), 'up' => array ( 0 => 'ref.gmp.php', 1 => 'Fonctions GMP', ), 'prev' => array ( 0 => 'function.gmp-divexact.php', 1 => 'gmp_divexact', ), 'next' => array ( 0 => 'function.gmp-fact.php', 1 => 'gmp_fact', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/gmp/functions/gmp-export.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.6.1, PHP 7, PHP 8)
gmp_export — Exportation vers une chaîne binaire
$num
, int $word_size
= 1, int $flags
= GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): stringExporte un nombre GMP vers une chaîne binaire.
num
Le nombre GMP à exporter.
word_size
La valeur par défaut est 1. Le nombre d'octets dans chaque partie de données binaires. Principalement utilisé avec le paramètre options.
flags
La valeur par défaut est GMP_MSW_FIRST
| GMP_NATIVE_ENDIAN
.
Retourne une chaîne de caractères.
Version | Description |
---|---|
8.0.0 |
Cette fonction ne retourne plus false en cas d'échec.
|
Exemple #1 Exemple avec gmp_export()
<?php
$number = gmp_init(16705);
echo gmp_export($number) . "\n";
?>
L'exemple ci-dessus va afficher :
AA