waynew Posted September 28, 2008 Share Posted September 28, 2008 Hey, I was just wondering if any of you guys know of any third party scripts etc that allow you to post PHP code and retain its formatting. It would also be nice if it did what your php bbcode does on here; as in color keywords etc. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/126197-show-code/ Share on other sites More sharing options...
DarkWater Posted September 28, 2008 Share Posted September 28, 2008 Just style some <pre> tags with CSS and use the highlight_string() function. Quote Link to comment https://forums.phpfreaks.com/topic/126197-show-code/#findComment-652565 Share on other sites More sharing options...
waynew Posted September 28, 2008 Author Share Posted September 28, 2008 How would I got about retaining tabs? Quote Link to comment https://forums.phpfreaks.com/topic/126197-show-code/#findComment-652567 Share on other sites More sharing options...
Daniel0 Posted September 28, 2008 Share Posted September 28, 2008 By leaving them alone? What do you mean? The tabs won't magically disappear. Quote Link to comment https://forums.phpfreaks.com/topic/126197-show-code/#findComment-652591 Share on other sites More sharing options...
trq Posted September 28, 2008 Share Posted September 28, 2008 Wrap your code in <pre> tags. Quote Link to comment https://forums.phpfreaks.com/topic/126197-show-code/#findComment-652592 Share on other sites More sharing options...
DarkWater Posted September 28, 2008 Share Posted September 28, 2008 I meant to put <pre> tags, but I forgot that the bbcode parser takes them and uses them literally and I forgot to use [nobbc]. >_< Quote Link to comment https://forums.phpfreaks.com/topic/126197-show-code/#findComment-652602 Share on other sites More sharing options...
Daniel0 Posted September 28, 2008 Share Posted September 28, 2008 Wrap your code in <pre> tags. Or any other tag with white-space:preserve; Quote Link to comment https://forums.phpfreaks.com/topic/126197-show-code/#findComment-652614 Share on other sites More sharing options...
waynew Posted September 29, 2008 Author Share Posted September 29, 2008 Thanks guys. No more bad-looking code for me. It's just that usually the tabs never stayed put. So I guess that the CSS preserve white space will do just fine. Quote Link to comment https://forums.phpfreaks.com/topic/126197-show-code/#findComment-652803 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.