how to break line in Textarea

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

how to break line in Textarea

Post by eshban »

hi,


can anybody tell me that how to break line in textarea.

i m doing like this but it shows <br> as string.


<textarea name="recreation_programs" readonly rows="10" cols="35">

Code: Select all

<?
     $x = 0; 
    while($x < $no_of_dang_community){
        print $result_dang_community[$x]['recreation_programs'].'<br/>';
        $x++;
    }
?>
</textarea>

Output:


tryt <br/> rtyryry5464 <br/> dasdaaaaaaaaa <br/> dasdaaaaaaaaa <br/>
User avatar
blacksnday
Forum Contributor
Posts: 252
Joined: Sat Jul 30, 2005 6:11 am
Location: bfe Ohio :(

Post by blacksnday »

could be any of the below:

Code: Select all

\r\n
\n
\r
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Post by Rovas »

Set a convient number of rows (5) and columns.
Read here more about the textarea tag http://www.w3schools.com/tags/tag_textarea.asp
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

Post by eshban »

i have already tried it

Code: Select all

\r\n
\n
\r
but it doesnot work
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Code: Select all

<?php
     $x = 0;
    while($x < $no_of_dang_community){
        print $result_dang_community[$x]['recreation_programs'] . "\n";
        $x++;
    }
?>
User avatar
blacksnday
Forum Contributor
Posts: 252
Joined: Sat Jul 30, 2005 6:11 am
Location: bfe Ohio :(

Post by blacksnday »

edit... astions beat me :P
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

Post by eshban »

thnax budyy...................


it is working........................ nice.....


but wats the reason when i used single quote instead of double quote
Post Reply