Jump to content

[SOLVED] highlight_file(); doesn't stay within CSS div's


Recommended Posts

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

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'));

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.