<?php
$texto = "<a><li>hhhhhhh</li></a>";
$a = array("/\<a(.*?)\>(.*?)\<\/a\>/is");
$b = array("$2");
$texto = preg_replace($a, $b, $texto);
echo $texto;
?>
Simplemente, en la variable $texto, pones el texto al que quieras quitar los enlaces.
Luego, cuando te salga en pantalla, puedes darle a Ver código fuente y copiar el código de ahí, o usar htmlentities() para que salga directamente:
<?php
$texto = "<a><li>hhhhhhh</li></a>";
$a = array("/\<a(.*?)\>(.*?)\<\/a\>/is");
$b = array("$2");
$texto = htmlentities(preg_replace($a, $b, $texto));
echo $texto;
?>
Listo.

1 comentarios:
sabes demasiado
Publicar un comentario en la entrada