PHP 8.3.4 Released!

convert_uuencode

(PHP 5, PHP 7, PHP 8)

convert_uuencode文字列を uuencode する

説明

convert_uuencode(string $string): string

convert_uuencode() は、uuencode アルゴリズムを使用して文字列をエンコードします。

uuencode はすべての文字(バイナリを含む)を表示可能な文字に変換し、 ネットワーク上での転送を可能にします。uuencode されたデータは、 元のデータより約 35% 大きくなります。

注意: convert_uuencode() 関数は、 uuencode された ファイル に含まれる beginend を両方生成しません。

パラメータ

string

エンコードしたいデータ。

戻り値

uuencode されたデータを返します。

変更履歴

バージョン 説明
8.0.0 これより前のバージョンでは、 空文字列を変換しようとすると、特別な理由がないのに false を返していました。

例1 convert_uuencode() の例

<?php
$some_string
= "test\ntext text\r\n";

echo
convert_uuencode($some_string);
?>

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

0=&5S=`IT97AT('1E>'0-"@``
`

参考

add a note

User Contributed Notes 2 notes

up
14
root at mantoru dot de
16 years ago
@Craig's note: base64_encode() is better suited for that. In fact, it produces smaller output and operates slightly faster. I did a little benchmark -- here are my findings:

File: JPG, 631614 bytes

== Base64 ==
execution time: 0.0039639472961426 secs
output length: 842152

== UUencode ==
execution time: 0.004105806350708 secs
output length: 870226
up
7
zash at zash dot se
15 years ago
note that using base64 or uuencode to store data in a database is pretty useless. if you properly escape your data and use a binary field (BLOB etc) there is no problem.
To Top