New Line Question
Moderator: General Moderators
- Sevengraff
- Forum Contributor
- Posts: 232
- Joined: Thu Apr 25, 2002 9:34 pm
- Location: California USA
- Contact:
New Line Question
Ok, I made a simple text-based news script, and it keeps news posts as one line on a text file. This means that if i hit return in the text area when i submit the news, it will mess everything up. Is there anyway I can not have this happen?
http://www.php.net/manual/en/function.str-replace.php
http://www.php.net/manual/en/function.nl2br.php
take a look at the user contributed notes
http://www.php.net/manual/en/function.nl2br.php
take a look at the user contributed notes
- Sevengraff
- Forum Contributor
- Posts: 232
- Joined: Thu Apr 25, 2002 9:34 pm
- Location: California USA
- Contact:
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
just make a new function then, and apply it to the input
say $post contained the information you wanted on one line, then just do
then that would work. but what i'd do, is right before it's printing, cause the source would be really cluttered if everything was on one line is:
say $post contained the information you wanted on one line, then just do
Code: Select all
str_replace("\n", "<br/>", $post);Code: Select all
echo str_replace("<br/>", "/n<br/>", $post);