Stopping word-wrap

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
theda
Forum Contributor
Posts: 332
Joined: Sat Feb 19, 2005 8:35 am
Location: USA

Stopping word-wrap

Post by theda »

I know there's the concept of the word wrap in php, but I'm curious, is there a way to STOP word wrap?

Example of what I don't want word-wrapped:
http://dumbass.ionichost.com/?id=source_main

The text kinda bunches up and makes the source code look 00glay... <_<
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

It's not PHP but...

Old style (before XHTML) was to use "nowrap" as an attribute... it's no longer valid in XHTML though.

Either, set:

Code: Select all

style=&quote;overflow:auto&quote;
in you DIV or I belive you can use something like:

Code: Select all

white-space: nowrap
But I'd check that on http://www.w3schools.com/css/ first ;)
theda
Forum Contributor
Posts: 332
Joined: Sat Feb 19, 2005 8:35 am
Location: USA

Post by theda »

This is how you get the source code of the files I used:

Code: Select all

<?
highlight_file("index.php");
?>
^_^;; Kind of difficult to add what you suggest when it'd be useless in the actual file that executes.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Believe me, I'm more than familiar with that function :P *sigh*

Code: Select all

<div style="width:700px; overflow:auto">
<?php
highlight_file($file);
?>
</div>
or if you're not validating XHTML (I don't think you can anyway if you use highlight_file() or highlight_string()...)

Code: Select all

<div style="width:700px" nowrap>
<?php
highlight_file($file);
?>
</div>
Post Reply