'.$items[1].''.stripslashes($string).''."\n";
}
}
}
*/
//---------
$non_utf8_encoding = api_get_non_utf8_encoding($language);
$list = file($file);
$xml = '';
foreach ( $list as $line ) {
if(substr($line, 0, 1)=='$') {
$items = array();
$match = preg_match('/^\$([^\s]*)\s*=\s*"(.*)";$/', $line, $items);
if($match) {
$string = $items[2];
if (!api_is_valid_utf8($string)) {
$string = api_html_entity_decode(api_utf8_encode($string, $non_utf8_encoding), ENT_QUOTES, 'UTF-8');
}
$xml .= ''.$items[1].''.stripslashes($string).''."\n";
}
}
}
//---------
if(empty($xml) && $language!='english')
{
return get_language_file_as_xml('english');
}
return $xml;
}
?>