1--TEST--
2Test mb_encode_mimeheader() function : usage variations - Pass different strings to $linefeed arg
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7/* (string $str [, string $charset [, string $transfer_encoding [, string $linefeed [, int $indent]]]])
8 * Description: Converts the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?=
9 * Source code: ext/mbstring/mbstring.c
10 */
11
12/*
13 * Pass different strings to $linefeed argument
14 */
15
16echo "*** Testing mb_encode_mimeheader() : usage variations ***\n";
17
18mb_internal_encoding('utf-8');
19
20$linefeeds = array("\r\n",
21                   "\n",
22                   "---");
23$str = base64_decode('zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868zrXOvc6/LiAwMTIzNDU2Nzg5Lg==');
24
25$iterator = 1;
26foreach ($linefeeds as $linefeed) {
27    echo "\n-- Iteration $iterator --\n";
28    var_dump(mb_encode_mimeheader($str, 'utf-8', 'B', $linefeed));
29    $iterator++;
30}
31
32
33echo "Done";
34?>
35--EXPECT--
36*** Testing mb_encode_mimeheader() : usage variations ***
37
38-- Iteration 1 --
39string(115) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=
40 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?="
41
42-- Iteration 2 --
43string(114) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=
44 =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?="
45
46-- Iteration 3 --
47string(116) "=?UTF-8?B?zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868?=--- =?UTF-8?B?zrXOvc6/LiAwMTIzNDU2Nzg5Lg==?="
48Done
49