I really like the numbered code lines on this forum. I would like to incorporate something like this on my own site, and was wondering how exactly it was done? I am assuming that its creating some type of loop, delimiting by newline character, and inserting the n+1 where n is the number last new line character integer.
numbered code lines
Collapse
X
-
Hi.
You could set up a loop, searching for \n characters using the strpos() function, which would give you their position. Meanwhile, you could use the substr_replace( ) function, inside the loop, to replace each of the new-line characters with an integer that is incremented each time.
If that's complete gibberish, please let me know and I'll try to rephrase.
Comment