MasterACE14 Posted January 10, 2008 Share Posted January 10, 2008 I am trying to use highlight_file(); within a div, but if the script I am highlighting is too wide(too many words on 1 line) it will creep out of the CSS div. This isn't a CSS problem, but a problem with the highlight_file(); function. I have tried to work around using highlight_file(); with no success. I have tried using include_once(); with strip_tags(); but it still executes the script, instead of showing the source. So I haven't even got as far as creating my own syntax highlighting script. is there another function I can use to highlight a external file? or is there a way to include the file, stop it from executing and then highlight the syntax myself? while still having it stay within the CSS div? Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/85460-solved-highlight_file-doesnt-stay-within-css-divs/ Share on other sites More sharing options...
teng84 Posted January 11, 2008 Share Posted January 11, 2008 try not to include the file try to read it as text file get contents and ouput that as plain text then use your function .. Quote Link to comment https://forums.phpfreaks.com/topic/85460-solved-highlight_file-doesnt-stay-within-css-divs/#findComment-436084 Share on other sites More sharing options...
trq Posted January 11, 2008 Share Posted January 11, 2008 Your problem more than liekly is that of a CSS issue, however... s there another function I can use to highlight a external file? or is there a way to include the file, stop it from executing and then highlight the syntax myself? You might try.... <?php highlight_string(file_get_contents('file.php')); ?> Quote Link to comment https://forums.phpfreaks.com/topic/85460-solved-highlight_file-doesnt-stay-within-css-divs/#findComment-436086 Share on other sites More sharing options...
MasterACE14 Posted January 11, 2008 Author Share Posted January 11, 2008 ok, thanks guys ACE Quote Link to comment https://forums.phpfreaks.com/topic/85460-solved-highlight_file-doesnt-stay-within-css-divs/#findComment-436142 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.