Re: explode string at new line
| From: | Davi | Date: | Wed, 06 Jun 2007 14:02:01 +0000 |
| Subject: | Re: explode string at new line | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-256177@lists.php.net to get a copy of this message | ||
Em Quarta 06 Junho 2007 10:54, Davi escreveu:
> But... Why does it happen:
>
> [code]
>
> $object=mysql_fetch_object($result);
>
> $texto = $object->texto;
>
> $texto=preg_replace("/\r|\n/","",stripslashes($texto));
> echo $texto;
>
> [/code]
>
> [output]
>
> Teste
> \r\nde formatação!
> \r\nTudo funcionando...
> \r\n
>
> [/output]
>
>
> I'm using stripslashse 'cause I'm getting the values from a DB.
>
> Any kind of tip?
>
> TIA
If I do:
[code]
echo "\r\nJust testing... \r\n again...";
[/code]
The output is:
[output]
Just testing... again...
[/output]
And the source code (in browser) is:
[output]
Just testing...
again...
[/output]
Am I missing anything?
TIA
--
Davi Vidal
davividal@siscompar.com.br
davividal@gmail.com
--
"Religion, ideology, resources, land,
spite, love or "just because"...
No matter how pathetic the reason,
it's enough to start a war. "
--------------------------------------------------------
Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Please don't do top-posting, put your reply below the following line.
--------------------------------------------------------
Attachment: [application/pgp-signature]
Attachment: [application/pgp-signature]