- print_r: documentation ( source)
<?php
$testcase =
'DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trello.com;
q=dns/txt; s=dkim; bh=zmLkmznXksSFNlY+E/SQwF4vaDducoC91+u20p18W38=;
h=from:sender:subject:to:mime-version:content-type;
b=XFKjy/g96z0Iv8qDg+IPb4EXYSujEVf/indwAV64icAXv/wceXEgQPLXury2HKBn5/Tk7DbgU
HW4duCjde16IKgMOd5xf7n8duXbzhEESD5a3CXSo9QNOjYH1hwsdx8oguz+RWL3Zw4ZJfXjGCzS
+LMZig06tV0tF8zFTuAHfRY=
Content-Type: multipart/alternative;
boundary="----sinikael-?=_1-14883656976170.4675149679677584';
function test($name, array $headers)
{
echo 'Test in mode "' . $name . '": ';
if (isset($headers['Content-Type'])) {
echo "OK!\n";
} else {
echo "Content-Type header not found:\n";
print_r($headers);
}
}
test('strict', iconv_mime_decode_headers($testcase, ICONV_MIME_DECODE_STRICT, 'utf-8'));
test('continue', iconv_mime_decode_headers($testcase, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'utf-8'));