hay alguna funcion parecida a htmlentities pero que funcione con XML en lugar de con HTML?
seria algo asi como "xmlentities".
en internet encontre la siguiente funcion:
Código:
function xmlentities($string, $quote_style=ENT_COMPAT)
{
$trans = get_html_translation_table(HTML_ENTITIES, $quote_style);
foreach ($trans as $key => $value)
$trans[$key] = '&#'.ord($key).';';
return strtr($string, $trans);
}
pero me parece extraño que no exista una funcion parecida en PHP.
gracias.