Welcome Guest, Not a member yet? Register   Sign In
how to change ENTER into <br /> on form_textarea??
#1

[eluser]yudahebat[/eluser]
I want to know if I press ENTER on form_textarea, it became to
Code:
<br />
how we make it??
so when we save it into the database it became to like this :

- line 1
- line 2
- line 3

NOT like this:
- line 1 - line 2 - line 3

please help me..
#2

[eluser]Peter Pan[/eluser]
Use the PHP Function nl2br.
#3

[eluser]yudahebat[/eluser]
explain me about php function nl2br please.. I'm newbie
#4

[eluser]Peter Pan[/eluser]
Very simple:
Code:
string nl2br  ( string $string  [, bool $is_xhtml= true  ] )

Returns string  with '<br />' or '<br>' inserted before all newlines.
#5

[eluser]yudahebat[/eluser]
give me an example sith some text please....
sorry Im very2 newbie on PHP
#6

[eluser]Bramme[/eluser]
If you're such a newbie to php you can't recognize a simple function, I suggest you first do some background reading (like PHP5 for Dummies) before even starting to fool around with CI...
#7

[eluser]yudahebat[/eluser]
I just wanna example of using nl2br to continue my work on CI...
Ive learn CI for 4-5 month but I have problem on textarea
please give the example...
I dont have a time to read PHP5 for dummies
I want practice2 n practice...
#8

[eluser]umefarooq[/eluser]
hi if you want to enter <br /> to you code use some wysiwyg editors like tinymce or fckeditor it will help you a lot
#9

[eluser]Peter Pan[/eluser]
Look at the documentation on php.net. There are some examples.
#10

[eluser]yudahebat[/eluser]
ok thx




Theme © iAndrew 2016 - Forum software by © MyBB