Jump to content

Archived

This topic is now archived and is closed to further replies.

ludjer

X--solved--Xusing auto new line in a form nl2br($club)

Recommended Posts

i have a form that takes what ever the user put into it a database
i would like it that when the user puts a new line in (hits Enter)
that a br is placed there
bit while the guy is typing but when he hits submit

thx alot

Share this post


Link to post
Share on other sites
str_replace("bad_letter","</br>",$form_field_name);

please read up on str_replace and also eregi_repalce as they are used on php codes daily to modify information form a database and will also intrest you
as a learner ok.

good luck.

Share this post


Link to post
Share on other sites
jenk can you kindly exsplin that syntex of nl2br() please and yes i have read on it but dont use it offthen.

can you kindly give an example and exspalin on the code cheers.

Share this post


Link to post
Share on other sites
[code]<?php

$text = "This
is
some
text";

echo nl2br($text);

?>[/code]

Will output:
[code]This<br />
is<br />
some<br />
text[/code]

:)

Share this post


Link to post
Share on other sites
does that mean when a user press the enter button to make a new line when there adding some text to a form that nl2br makes the <Br/> happen.

and thank you so much cheers.

Share this post


Link to post
Share on other sites
not instantly, but if you pass the data through nl2br on processing, yes it will.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.