PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
code for my forums, but I figured it'd be easier if there were already a function... Plus, these forums number the lines too. Which I can't seem to figure out, as highlight_string() gets rid of \n, so there's no way to know where the line numbers are. ^^;
So anyway, would someone mind posting the function for these forums or a similar one?
I've tried using GeSHi, btw. Takes too long to load, though. >.>
A bit of regex sorts the <? ?> issue out (check that the tags are there... if the aren't then you need to add them but make sure you take them back out of the highlighted code.
tags on this forum actually just manipulate the highlight_string() output
It just take some regex work to get it going.
If your only issues are line numbers and tags then you shouldn't have too much trouble
I may have some code I can dig up actually which adds the tags if they aren't there (in my unorganised mess of server directories )