I need a php script that will color text in a text file according to a set of simple rules. This should handle not only A-Z a-z alphabetic characters but also Chinese characters, dividing up the "words" based on whitespace. The file will always have whitespace or numbers between "words".
The script will choose the colors based on numbers that are included in the text.
The script should ignore numbers that stand alone (are surrounded by whitespace) as they are not representing a desired color change (for example, if there is a year in the text).
For the string "this1 is2 a3 sentence4, right5? Yes, 19,294 people1 say4 so3." the output should be:
"this is a sentence, right? Yes, 19,294 people say so."
and the colors of the words should be:
this = blue
is = green
a = black
sentence = red
right = gray
Yes = black (because it does not have a number on it)
19,294 = black
say = red
so = black
Punctuation should be black.