ok so i was building a syntax highlighter for my site/project that would mod the post/data before it hit the database so when a post was made only the correct parts of that post was highlighted within a codebox.
i came into an issue with the /** commented out text */ section of this as where it would comment the post out. but if a certain keyword from the php name array was in the commented out text it would then change to its respected color.
now ive had many suggestions to fixing this but all have failed when ive attempted it.
so im gonna let this out so anyone that wants to attempt to fix it or try and solve it can.
i should also add i have added a line of data inside the file for testing purposes to see the outcome and display the Demo of problem.
i use the line of text for the testing/build of the script.
oops accidently deleted the demo, (back up and running now)
and thank you, will look into the function.
edited
sadly just like preg_quote this just added \ next to chars like $, it didnt however stop preg_replace or str_replace
from find the word it was looking for. so it just ended up looking like.
$Variable
bypassing the \ and still finding its mark.
also it didnt help much against none special symbols. for example: words from inside the arrays still get caught too.
/** some normal text then preg_replace **/
would appear.
Exactly why we should bounce ideas and try to make it right, you only to test those ideas only because you are most familiar with it, just if its not too much enoying to you. 🙂
arnage wrote:
Exactly why we should bounce ideas and try to make it right, you only to test those ideas only because you are most familiar with it, just if its not too much enoying to you. :)
thats cool mate. although its not hard to see whats going on in the file.
top of file is all the arrays, and bottom half consists of 3 checks.
a 3 box check.
a 2 box check
a 1 box check.
and in each box check theres some preg_match_all, preg_replace, str_replace functions. thats basically it.