this snippet highlights a php file and numberes the lines.
show php code in a nice layout.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
this snippet highlights a php file and numberes the lines.
show php code in a nice layout.
<!--lixlpixel-->
<?php
// specify the file to highlight
$file_to_highlight = __file__;
echo '
<table style="border: 0; spacing: 0; margin: 0; width: 600px;">
<tr>
<td style="width: 20px;
background-color: #D4D4D4;
padding-right: 2px;
padding-left: 2px;
text-align: right;
vertical-align: top;">
<pre style="margin: 0; padding: 0;">';
$temp = file($file_to_highlight);
for($i = 1; $i <= count($temp); $i++)
{
echo $i.'
';
}
echo '
</pre>
</td>
<td style="width: 580px;
background-color: #FFFFFF;
padding-right: 5px;
padding-left: 5px;
vertical-align: top;">';
highlight_file($file_to_highlight);
echo '
</td>
</tr>
</table>
';
?>
|