Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Automatic Wrapping

Jul 31, 2005 5:13AM PDT

Basically I have some code written in PHP that I wish to be viewed by visitors to my site. It's sort of a tutorial. Only currently the only way I know how to let the code be shown without formatting is by using the <pre></pre> tags. I just wanted to know if there was a way to wrap the text automatically if it extended beyond a certain length (in pixels).

Thanks,
Angelo

Discussion is locked

- Collapse -
use < and > or . . .
Jul 31, 2005 5:51AM PDT

use < and > instead of < and >. So if you needed to show something like

<?php
do something do something else do something do something do something do something
?>

you would use

<?php
do something do something else do something do something do something do something
?>

Another way would be to put the code into a textarea

- Collapse -
Is this the only way?
Jul 31, 2005 10:28AM PDT

I was toying with this idea too... if this is the only way to do it, seems like I must :S... Time to re-configure cms Silly