Question regarding highlight_string.....

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!

Moderator: General Moderators

Post Reply
techgnome
Forum Newbie
Posts: 2
Joined: Wed Jun 25, 2003 4:15 pm
Contact:

Question regarding highlight_string.....

Post by techgnome »

I'm in the process of building a website where people can submit articles and such. As part of the "enhancements" we are trying to do is color coding code peices. I'm trying to use highlight_string since that seems to already to the functionality I need. However, I'm having a bit of a problem with it.
If I pass it a piece of code that uses double-quites " for the string, it turns on the right color, but never seems to turn it off.....If we use single quoes ' it comes out OK.
What gives? Any clues?
Flood
Forum Newbie
Posts: 11
Joined: Wed Jun 25, 2003 4:52 pm

Post by Flood »

Could you please give an example?

/Flood
techgnome
Forum Newbie
Posts: 2
Joined: Wed Jun 25, 2003 4:15 pm
Contact:

Post by techgnome »

For some reason, it had to do with the quotes not being properly escaped....
We've since found a work around, but here's what the original results was like:
http://developerkb.jodohost.com/modules ... 9&forum=22

how ever, our work around resulted in yet another problem in which things are being replaced when they shouldn't be....l
http://developerkb.jodohost.com/modules ... =22&jump=1

The sample code in the second example should have \\ where it shows \, and \\\\ where it shows \\.... it's all very wierd and confusing.
Post Reply