Ik heb de volgende code:
Het wordt allemaal wel leuk gehighlight, maar die highlight_string() functie zet er de <code> en </code> tags bij. En dat wil ik niet!!
Ik krijg ze ook niet weg met de str_replace.
Iemand een idee?
PHP:
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
| <? <html> <head> <title></title> <link href="styles.css" rel="StyleSheet" type="text/css"> </head> <body> <? function colorsource($source) { clearstatcache(); if(!file_exists($source)) { return 1; } $handle=fopen($source,"r"); //open source code $size=filesize($source); $temp=fread($handle, $size); $colorcode=highlight_string($temp); //give the color return 0; } echo "<span class=\"bodytext\">"; $colorsource = colorsource("show.php"); $colorsource=str_replace("<code>", "", $colorsource); $colorsource=str_replace("</code>", "", $colorsource); echo "</span>"; ?> </body> </html> ?> |
Het wordt allemaal wel leuk gehighlight, maar die highlight_string() functie zet er de <code> en </code> tags bij. En dat wil ik niet!!
Ik krijg ze ook niet weg met de str_replace.
Iemand een idee?