Re: Wrapping text output
| From: | Justin French | Date: | Sat, 22 Mar 2003 06:50:53 +0000 |
| Subject: | Re: Wrapping text output | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140671@lists.php.net to get a copy of this message | ||
on 22/03/03 3:57 PM, Philip J. Newman (newmanpj@philipnz.com) wrote:
> $my_data = "This is a really long string that could go on for ever and ever
> and ever and ever and ever and ever and ever and ever and ever and ever and
> ever and ever and ever and don't wrap to my table it makes it bigger";
>
> echo $my_data;
>
> How can I make this wrap to the table?
Errrrr:
<table width="330">
<tr><td><?=$my_data?></td></tr>
</table>
This text will wrap inside a table, according to every browser I've ever
used.
If you want to wrap for other purposes, eg email or raw text, then
$my_data = wordwrap($my_data,65);
will word-wrap at 65 characters, which is pretty pointless with variable
width fonts, but okay with fixed width fonts.
Justin