Mailparse mailparse_rfc822_parse_addresses

(PECL mailparse >= 0.9.0)

mailparse_rfc822_parse_addresses — RFC 822 호환 주소 구문 분석


설명

mailparse_rfc822_parse_addresses(string $addresses): array

To: header에 있는 것과 같은 » RFC 822 준수 수신자 목록을 파싱합니다.


매개변수

addresses
Wez Furlong <wez@example.com>, doe@example.com과 같은 주소를 포함하는 문자열

메모: 이 문자열에는 헤더 이름이 포함되지 않아야 합니다.


반환 값

각 수신자에 대해 다음 키가 있는 연관 배열의 배열을 반환합니다.

display 표시 목적으로 받는 사람 이름입니다. 수신자에 대해 이 부분이 설정되지 않은 경우 이 키는 address와 동일한 값을 유지합니다.
address 이메일 주소
is_group 수신자가 뉴스 그룹이면 true, 그렇지 않으면 false입니다.

Examples

예제 #1 mailparse_rfc822_parse_addresses() 예제

                  
<?php

$to = 'Wez Furlong <wez@example.com>, doe@example.com';
var_dump(mailparse_rfc822_parse_addresses($to));

?>
                  
                

위의 예는 다음을 출력합니다.

array(2) {
  [0]=>
  array(3) {
    ["display"]=>
    string(11) "Wez Furlong"
    ["address"]=>
    string(15) "wez@example.com"
    ["is_group"]=>
    bool(false)
  }
  [1]=>
  array(3) {
    ["display"]=>
    string(15) "doe@example.com"
    ["address"]=>
    string(15) "doe@example.com"
    ["is_group"]=>
    bool(false)
  }
}