Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [PHP-DB] end of line
Try this:
echo str_replace ( "\n", "<p>", $string);

I believe it always stores newlines as \n, since PHP and MySQL are
native to Unix/Linux.
--
Marcjon

Report this thread to moderator Post Follow-up to this message
Old Post
Marcjon
08-30-04 08:56 AM


Re: [PHP-DB] end of line
"Marcjon" <marcjon@fastmail.fm> wrote in message
news:1093844358.24698.203307089@webmail.messagingengine.com...
> Try this:
> echo str_replace ( "\n", "<p>", $string);
>
> I believe it always stores newlines as \n, since PHP and MySQL are
> native to Unix/Linux.
> --
>   Marcjon

Or use the PHP built-in function nl2br():
http://de3.php.net/manual/en/function.nl2br.php

Regards, Torsten Roehr

Report this thread to moderator Post Follow-up to this message
Old Post
Torsten Roehr
08-30-04 01:57 PM


Re: [PHP-DB] end of line
I would start with a <p>, then print the data from the database,
str_replace("\n","<p></p>",$string); and then end with a </p>, that way you
have opening and closing <p></p> tags.

--


-------------------------------------------------------------->>
Jasper Howard :: Database Administration
Velocity7
1.530.470.9292
http://www.Velocity7.com/
<<--------------------------------------------------------------
"Marcjon" <marcjon@fastmail.fm> wrote in message
news:1093844358.24698.203307089@webmail.messagingengine.com...
> Try this:
> echo str_replace ( "\n", "<p>", $string);
>
> I believe it always stores newlines as \n, since PHP and MySQL are
> native to Unix/Linux.
> --
>   Marcjon

Report this thread to moderator Post Follow-up to this message
Old Post
Jasper Howard
08-30-04 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:55 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.