tooltiperror
Super Moderator
- Reaction score
- 231
So, I want to highlight PHP variables.
The idea would be to take a string of PHP code and use preg_replace to search for a regular expression, and then replace it with itself along with the desired color codes.
I know the regular expression should begin by finding $ and then parse each alphanumeric character or underscore, then stop when it meets a different character or space (since all PHP variables follow that format)
How would I do this in code?
The idea would be to take a string of PHP code and use preg_replace to search for a regular expression, and then replace it with itself along with the desired color codes.
I know the regular expression should begin by finding $ and then parse each alphanumeric character or underscore, then stop when it meets a different character or space (since all PHP variables follow that format)
How would I do this in code?