RE: [PHP] Word Wrap on highlight_file

From: Date: Mon, 21 Jan 2008 03:40:46 +0000
Subject: RE: [PHP] Word Wrap on highlight_file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-267742@lists.php.net to get a copy of this message
One solution I can think of is: $showCode = highlight_file($fileWithPath, true); echo str_replace('<br />', "<br />\n", $showCode); It may not be the best one. But it's not recommanded to use echo wordwrap($showCode, 70); Because you may break <br /> into something like XXXXXXXXXXXX<br /> Regards, Shelley -----Original Message----- From: Tom Chubb [mailto:tomchubb@gmail.com] Sent: Wednesday, January 16, 2008 9:02 PM To: PHP General List Subject: [PHP] Word Wrap on highlight_file Can anyone tell me how to wrap the results of highlight_file so it doesn't mess up the size of my table div? I tried the following and doesn't work! if ($ext == "phps") { $showcode = highlight_file($pathtoscripts . $_GET['file']); echo wordwrap($showcode, 70); } else { echo "Nice try, but you are not authorised to view the source of files with a $ext extension! ;)\n"; } Thanks, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#267742) next »