RE: [PHP-DB] Line breaks from a database!
| From: | USA) | Date: | Tue, 02 Jul 2002 15:43:17 +0000 |
| Subject: | RE: [PHP-DB] Line breaks from a database! | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20274@lists.php.net to get a copy of this message | ||
Well, here's what I got, since I put the data into the table directly it had no extra slashes
so it looked like this '\n' , but when retrieving it i ended up with '\\n'. I
would have expected stripSlashes to work but that turned them into 'n'. Here's what I
did as a workaround:
function strip($string){
$string = str_replace("\\n","\n", $string);
return $string;
}
believe it or not, this works when stripSlashes does not. Anyone know why?
<>< Ryan
"Ryan Jameson (USA)" <RJameson@usa.ibs.org> said:
> Hi guys, maybe I'm missing something silly but when I retrieve a string
from my SQL server with '\n' in it, they are displayed literally instead of
as line breaks. StripSlashes only turns them into 'n'.
>
> Any ideas?
>
> <>< Ryan
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php