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