On this page
function _locale_import_parse_header
_locale_import_parse_header($header)
Parses a Gettext Portable Object file header
Parameters
$header: A string containing the complete header.
Return value
An associative array of key-value pairs.
Related topics
File
- includes/locale.inc, line 1215
- Administration functions for locale.module.
Code
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;
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!locale.inc/function/_locale_import_parse_header/7.x