<?php

function numeric_entities($string){ 
	$mapping_hex = array(); 
	$mapping_dec = array(); 
	foreach (get_html_translation_table(HTML_ENTITIES, ENT_QUOTES) as $char => $entity){ 
		$mapping_hex[html_entity_decode($entity,ENT_QUOTES,"UTF-8")] = '&#x' . strtoupper(dechex(ord(html_entity_decode($entity,ENT_QUOTES)))) . ';'; 
		$mapping_dec[html_entity_decode($entity,ENT_QUOTES,"UTF-8")] = '&#' . ord(html_entity_decode($entity,ENT_QUOTES)) . ';'; 
	} 
	$mapping_hex["Č"] = "&#x10C;";
	$mapping_hex["č"] = "&#x10D;";
	$mapping_hex["Ď"] = "&#x10E;";
	$mapping_hex["ď"] = "&#x10F;";
	$mapping_hex["Ľ"] = "&#x13D;";
	$mapping_hex["ľ"] = "&#x13E;";
	$mapping_hex["Ň"] = "&#x147;";
	$mapping_hex["ň"] = "&#x148;";
	$mapping_hex["ô"] = "&#xF4;";
	$mapping_hex["Ř"] = "&#x158;";
	$mapping_hex["ř"] = "&#x159;";
	$mapping_hex["Š"] = "&#x160;";
	$mapping_hex["š"] = "&#x161;";
	$mapping_hex["Ť"] = "&#x164;";
	$mapping_hex["ť"] = "&#x165;";
	$mapping_hex["ü"] = "&#xFC;";
	$mapping_hex["Ž"] = "&#x17D;";
	$mapping_hex["ž"] = "&#x17E;";
	$string = str_replace(array_values($mapping_hex),array_keys($mapping_hex) , $string); 
	$string = str_replace(array_values($mapping_dec),array_keys($mapping_dec) , $string); 
	return $string; 
}
function xmlentities($string) {
	return str_replace(Array('&','"',"'",'<','>'),Array('&amp;','&quot;','&apos;','&lt;','&gt;'),$string);
}
function parseXMLStr($val) {
	if (is_object($val))
		$val = strip_tags($val->asXML());
	return $val;
}
function removeCells($xml, $i, $j, $k) {
	for ($l=20;$l>9;$l--)
		unset($xml->Worksheet[$i]->Table[$j]->Row[$k]->Cell[$l]);
	return $xml;
}

?>