|
-
Oct 10th, 2006, 02:11 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED]TEXT Field
when i show a text field into area box from table, it comes nicely with formated text but when i try to show in a <td>, its messed up.
like
in area box -
Istiaque Sami
Ambarkhana
Sylhet - 3100
Bangladesh
in TD
Istiaque Sami Ambarkhana Sylhet - 3100
Bangladesh
why?
Last edited by samsyl; Oct 11th, 2006 at 03:36 PM.
-
Oct 10th, 2006, 06:49 PM
#2
Re: TEXT Field
because line breaks do not show up in HTML pages unless you break the line using the "<BR>" tag. you can simply do this before you put it in the <TD>:
PHP Code:
//assuming $data is your information, you can do this:
$data = str_replace("\n", "<br />", $data);
$data = str_replace("\r", "", $data);
//now, you can put it in the td
echo "<td>$data</td>\n";
This will remove line breaks and carriage returns from your data and replace them with one line break in HTML.
-
Oct 11th, 2006, 03:35 PM
#3
Thread Starter
Hyperactive Member
Re: TEXT Field
Thanks. Its working nicely.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|