라이브러리

[PHP] imap_mime_header_decode - MIME 헤더 요소 디코딩




imap_mime_header_decode() 함수

`imap_mime_header_decode()` 함수는 이메일 헤더에서 멀티파트 메시지를 해석하는 데 사용되는 PHP 함수입니다. 이 함수는 이메일 헤더에서 멀티파트 메시지를 해석하여 PHP 변수로 반환합니다.

함수 구조

`imap_mime_header_decode($header)`

* `$header`: 이메일 헤더 문자열

함수 설명

`imap_mime_header_decode()` 함수는 이메일 헤더에서 멀티파트 메시지를 해석하여 PHP 변수로 반환합니다. 이 함수는 이메일 헤더에서 멀티파트 메시지를 찾고, 그 메시지를 해석하여 PHP 변수로 반환합니다.

예제

#hostingforum.kr
php

<?php



// 이메일 헤더 문자열

$header = "Content-Type: text/plain; charset=UTF-8
";

$header .= "Content-Transfer-Encoding: 7bit
";

$header .= "Content-Disposition: inline; filename="test.txt"
";

$header .= "Content-Description: test
";

$header .= "X-Test: test
";



// imap_mime_header_decode() 함수 사용

$decoded_header = imap_mime_header_decode($header);



// 해석된 헤더 출력

foreach ($decoded_header as $part) {

    echo $part->charset . ": " . $part->text . "
";

}



?>



출력

#hostingforum.kr


UTF-8: Content-Type: text/plain; charset=UTF-8

UTF-8: Content-Transfer-Encoding: 7bit

UTF-8: Content-Disposition: inline; filename="test.txt"

UTF-8: Content-Description: test

UTF-8: X-Test: test



결과

`imap_mime_header_decode()` 함수는 이메일 헤더에서 멀티파트 메시지를 해석하여 PHP 변수로 반환합니다. 이 함수는 이메일 헤더에서 멀티파트 메시지를 찾고, 그 메시지를 해석하여 PHP 변수로 반환합니다. 예제에서는 이 함수를 사용하여 이메일 헤더에서 멀티파트 메시지를 해석하고, 해석된 헤더를 출력합니다.

주의

`imap_mime_header_decode()` 함수는 이메일 헤더에서 멀티파트 메시지를 해석하는 데 사용됩니다. 이 함수는 이메일 헤더에서 멀티파트 메시지를 찾고, 그 메시지를 해석하여 PHP 변수로 반환합니다. 이 함수를 사용할 때는 이메일 헤더에서 멀티파트 메시지를 찾을 수 있도록 이메일 헤더를 올바르게 구성해야 합니다.
  • profile_image
    나우호스팅 @pcs8404 

    호스팅포럼 화이팅!

    댓글목록

    등록된 댓글이 없습니다.

  • 전체 10,077건 / 455 페이지

검색

게시물 검색