I need to write text in which each character can be separately colored. I found out that the Tag Text plugin can do that.
The way Tag Text works is that you give the letters you want to color a tag by giving them a class. For example if I wanted to color the letter "t" in the sentence "My example sentence" I would have to type it like this:
My example sen<class="tagged">t</class>ence.[/code:1m7uwsbc]
I need to choose which letters to color dynamically based on variables. How should I approach this problem? My initial thoughts are that I should maybe store each letter of the sentence separately in an array so that I can loop through them and add the class when needed.
Is it possible to take a sentence and automatically store each letter in an array? I'm trying to avoid having to put each letter by hand to it's place in the array.
Any thoughts are welcome!