Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/07/2005, 15:51
Avatar de haron
haron
 
Fecha de Ingreso: febrero-2004
Ubicación: Cádiz (refinitivo)
Mensajes: 632
Antigüedad: 20 años, 2 meses
Puntos: 3
htmlentities para xml

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.
__________________
Si ocurre algo importante, estamos afuera fumándonos unos cigarritos.