PHP convert_uuencode() 函數
PHP String 參考手冊
實例
編碼字符串:
<?php
$str = "Hello world!";
echo convert_uuencode($str);
?>
運行實例 ?
定義和用法
convert_uuencode() 函數使用 uuencode 算法對字符串進行編碼。
注釋:該函數把所有字符串(包括二進制)編碼為可打印的字符,確保其數據庫存儲及網絡傳輸的安全。請記住,在重新使用數據前,請使用 convert_uudecode() 函數。
注釋:uuencoded 數據比原數據大約增大 35%。
語法
參數 | 描述 |
string | 必需。規定要進行 uuencode 編碼的字符串。 |
技術細節
返回值: | 返回 uuencoded 編碼的數據。 |
PHP 版本: | 5+ |
更多實例
實例 1
編碼字符串,然后對它進行解碼:
<?php
$str = "Hello world!";
// Encode the string
$encodeString = convert_uuencode($str);
echo $encodeString . "<br>";
// Decode the string
$decodeString = convert_uudecode($encodeString);
echo $decodeString;
?>
運行實例 ?
PHP String 參考手冊