Just use:
$post = str_replace("\n\n", "<br><br>", $post);
The str_replace replaces something like $string = str_replace("Letters in this", "New Letters", $string)
Elfyn McBratney wrote:
Hi,
Im creating a forum and i have run into a problem. When the user submits a post to the forum i want to be able to take the format the data into html but i dont know how.
This is the knid of thing i mean...
--- form.html ---
<textarea style="height: 300px; width: 300px;" name="post">
This is just a paragraph. and this is just a sentance. And this is just me babbling on...
This is just a paragraph. and this is just a sentance. And this is just me babbling on...
</textarea>
--- form.html ---
and i want to take that form-data and format it like this...
--- formatted.html ---
<p>
This is just a paragraph. and this is just a sentance. And this is just me babbling on...
</p>
<p>
This is just a paragraph. and this is just a sentance. And this is just me babbling on...
</p>
--- formatted.html ---
and then i'll write it to the html file using @fopen.
does anyone know how i can do this?
Cheers,
Elfyn