Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. <?php
  2. function highlight_num($file)
  3. {
  4.   $lines = implode(range(1, count(file($file))), '<br />');
  5.   $content = highlight_file($file, true);
  6.  
  7.     echo '
  8.    <style type="text/css">
  9.         .num {
  10.        float: left;
  11.        color: gray;
  12.        font-size: 13px;    
  13.        font-family: monospace;
  14.        text-align: right;
  15.        margin-right: 6pt;
  16.        padding-right: 6pt;
  17.        border-right: 1px solid gray;}
  18.  
  19.        body {margin: 0px; margin-left: 5px;}
  20.        td {vertical-align: top;}
  21.        code {white-space: nowrap;}
  22.    </style>';
  23.  
  24. echo "
  25. <table>
  26. <tr>
  27. <td class=\"num\">\n$lines\n</td><td>\n$content\n</td>
  28. </tr>
  29. </table>";
  30. }
  31. highlight_num(__FILE__);
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement