Parses a Gettext Portable Object file header
$header: A string containing the complete header.
An associative array of key-value pairs.
function _locale_import_parse_header($header) {
$header_parsed = array();
$lines = array_map('trim', explode("\n", $header));
foreach ($lines as $line) {
if ($line) {
list($tag, $contents) = explode(":", $line, 2);
$header_parsed[trim($tag)] = trim($contents);
}
}
return $header_parsed;
}