English | 简体中文 | 繁體中文
查询

imap_utf7_decode()函数—用法及示例

「 将 IMAP UTF-7 编码字符串转换为 ISO-8859-1 字符串 」


函数名:imap_utf7_decode()

适用版本:PHP 4, PHP 5, PHP 7

函数说明:imap_utf7_decode() 函数将 IMAP UTF-7 编码字符串转换为 ISO-8859-1 字符串。

用法: string imap_utf7_decode ( string $text )

参数:

  • text:要解码的 IMAP UTF-7 编码字符串。

返回值: 返回解码后的 ISO-8859-1 字符串。

示例:

<?php
$text = "&BdUXPOM0xDk-"; // IMAP UTF-7 编码的字符串
$decodedText = imap_utf7_decode($text);
echo $decodedText; // 输出:你好
?>

在上面的示例中,我们将 "&BdUXPOM0xDk-" 这个 IMAP UTF-7 编码的字符串传递给 imap_utf7_decode() 函数,函数将其解码为 ISO-8859-1 编码的字符串 "你好",然后将其输出到屏幕上。

请注意,imap_utf7_decode() 函数只能解码 IMAP UTF-7 编码的字符串,如果传递其他编码的字符串,将会导致解码失败。

补充纠错
上一个函数: imap_utf7_encode()函数
下一个函数: imap_unsubscribe()函数
热门PHP函数
分享链接