CakeFest 2024: The Official CakePHP Conference

gmp_export

(PHP 5 >= 5.6.1, PHP 7, PHP 8)

gmp_exportバイナリ文字列にエクスポートする

説明

gmp_export(GMP|int|string $num, int $word_size = 1, int $flags = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string

GMP数をバイナリ文字列にエクスポートします。

パラメータ

num

エクスポートするGMP数

word_size

デフォルト値は1です。 バイナリデータのチャンクごとのバイト数を指定します。 これはオプションパラメータと組み合わせて主に使います。

flags

デフォルト値は GMP_MSW_FIRST | GMP_NATIVE_ENDIAN です。

戻り値

文字列を返します。

変更履歴

バージョン 説明
8.0.0 この関数は、失敗時に false を返さなくなりました。

例1 gmp_export() の例

<?php
$number
= gmp_init(16705);
echo
gmp_export($number) . "\n";
?>

上の例の出力は以下となります。

AA

参考

  • gmp_import() - バイナリ文字列からインポートする

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top