wp_iso_descrambler

函式
wp_iso_descrambler ( $string )
引數
  • (string) $string Subject line.
    Required:
返回值
  • (string) Converted string to ASCII.
定義位置
相關方法
wp_is_writablewp_is_streamwp_is_mobileis_iterablewin_is_writable
引入
1.2.0
棄用
-

wp_iso_descrambler: 這個函式用來解讀WordPress中被擾亂的ISO字元。它接收一個字串作為引數,並返回解擾後的字串。

從電子郵件主題轉換為ASCII。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_iso_descrambler( $string ) {
/* this may only work with iso-8859-1, I'm afraid */
if ( ! preg_match( '#=?(.+)?Q?(.+)?=#i', $string, $matches ) ) {
return $string;
} else {
$subject = str_replace( '_', ' ', $matches[2] );
return preg_replace_callback( '#=([0-9a-f]{2})#i', '_wp_iso_convert', $subject );
}
}
function wp_iso_descrambler( $string ) { /* this may only work with iso-8859-1, I'm afraid */ if ( ! preg_match( '#=?(.+)?Q?(.+)?=#i', $string, $matches ) ) { return $string; } else { $subject = str_replace( '_', ' ', $matches[2] ); return preg_replace_callback( '#=([0-9a-f]{2})#i', '_wp_iso_convert', $subject ); } }
function wp_iso_descrambler( $string ) {
	/* this may only work with iso-8859-1, I'm afraid */
	if ( ! preg_match( '#=?(.+)?Q?(.+)?=#i', $string, $matches ) ) {
		return $string;
	} else {
		$subject = str_replace( '_', ' ', $matches[2] );
		return preg_replace_callback( '#=([0-9a-f]{2})#i', '_wp_iso_convert', $subject );
	}
}

常見問題

FAQs
檢視更多 >