関数 decode_mime_string ($string) {
$ pos = strpos($string, '=?');
if (!is_int($pos)) {
return $string;
}
$preceding = substr($string, 0, $pos); // 先行するテキストを保存します
$search = substr($string, $pos+2, 75 ); /* MIME ヘッダーの仕様によれば、これは 1 つのエンコードされた単語の最長です */
$d1 = strpos($search, '?');
if (!is_int($d1)) {
return $string;
}
$charset = substr($string, $pos +2、$d1);
$search = substr($search, $d1+1);
$d2 = strpos($search, '?');
if (!is_int($d2)) {
return $string;
}
$encoding = substr($search, 0, $d2);
$search = substr($search, $d2+1);
$end = strpos($search, '?=');
if (!is_int($end)) {
return $string;
}
$encoded_text = substr($search, 0, $end);
$rest = substr($string, (strlen($preceding . $charset . $エンコーディング . $encoded_text)+6));
スイッチ ($encoding) {
case 'Q':
case 'q':
$ encoded_text = str_replace('_', '%20', $encoded_text);
$encoded_text = str_replace('=', '%', $encoded_text);
$decoded = urldecode($encoded_text);
if (strto lower($charset) == 'windows-1251' ) {
$decoded = convert_cyr_string($decoded, 'w', 'k');
}
休憩;
ケース 'B':
ケース 'b':
$decoded = urldecode (base64_decode($encoded_text));
if (strto lower($charset) == 'windows-1251' ) {
$decoded = convert_cyr_string($decoded, 'w', 'k');
}
休憩;
デフォルト:
$decoded = '=?' 。 $文字セット . '?' 。 $エンコーディング . '?' 。 $encoded_text . '?=';
休憩;
}
return $preceding 。 $デコードされた . decode_mime_文字列($rest);
} // decode_mime_string()

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

PhpStorm Mac バージョン
最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール

SAP NetWeaver Server Adapter for Eclipse
Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

SublimeText3 英語版
推奨: Win バージョン、コードプロンプトをサポート!

AtomエディタMac版ダウンロード
最も人気のあるオープンソースエディター

Dreamweaver Mac版
ビジュアル Web 開発ツール
