Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/04/2007, 16:43
Avatar de leopardix
leopardix
(Desactivado)
 
Fecha de Ingreso: diciembre-2003
Mensajes: 91
Antigüedad: 20 años, 4 meses
Puntos: 0
Función para reemplzar saltos de linea

Hola amigos. Ya no puedo más... necesito ayuda.
Estoy creando una herramienta que extrae de un párrafo de texto las palabras más relevantes. Todo bien menos al momento de crear los links hacia esas palabras. Qué ocurre?? Que utilizo esta función para reemplazar etiquetas del texto pero por algún motivo hay saltos de linea que no reemplaza esta función y en html me quedan links cortados así:

Código HTML:
Palabras Claves:<a href=australia-es.htm target=_top>australia</a>, <a href=
-es.htm target=_top>
</a>, <a href=como-es.htm target=_top>como</a>, <a href=hasta-es.htm target=_top>hasta</a>, <a href=turismo-es.htm target=_top>turismo</a>, <a href=un-es.htm target=_top>un</a>, <a href=también-es.htm target=_top>también</a>, <a href=más-es.htm target=_top>más</a>, <a href=desde-es.htm target=_top>desde</a>, <a href=sydney-es.htm target=_top>sydney</a>, <a href=excursiones-es.htm target=_top>excursiones</a>, <a href=mundo-es.htm target=_top>mundo</a>, <a href=son-es.htm target=_top>son</a>, <a href=tropicales-es.htm target=_top>tropicales</a>, <a href=cuando-es.htm target=_top>cuando</a>, <a href=allá-abajo-es.htm target=_top>allá abajo</a>, <a href=
-
el-turismo-es.htm target=_top>
 
el turismo</a>, <a href=australia-occidental-es.htm target=_top>australia occidental</a>, <a href=tierras-vírgenes-es.htm target=_top>tierras vírgenes</a>, <a href=van-desde-es.htm target=_top>van desde</a>,

Si véis bien, hay una parte en la que queda un salto de linea y se corta el código html quedando el link roto. ¿Alguien sabe porqué y cómo solucionarlo?

Código PHP:
$parsestring str_replace (","""$parsestring);
$parsestring str_replace ("\n"""$parsestring);
$parsestring str_replace (")"""$parsestring);
$parsestring str_replace ("("""$parsestring);
$parsestring str_replace ("."""$parsestring);
$parsestring str_replace ("'"""$parsestring);
$parsestring str_replace ('"'""$parsestring);
$parsestring str_replace ("<b>"""$parsestring);
$parsestring str_replace ("<br>"""$parsestring);
$parsestring str_replace ("/>"""$parsestring);
$parsestring str_replace ("<"""$parsestring);
$parsestring str_replace ("”"""$parsestring);
$parsestring str_replace ("br"""$parsestring);
$parsestring str_replace ("<br />"""$parsestring);
$parsestring str_replace ("&nbsp;"""$parsestring);
$parsestring str_replace ("<p>;"""$parsestring);
$parsestring str_replace ("</p>;"""$parsestring); 
El problema se puede ver en:
http://www.yabuscador.es/5_Que_visit..._Australia.htm

Casi al final aparece un texto que dice "el turismo" pero el link está roto por culpa del salto de linea que no logro reemplazar con ninguna función.