2
I need to do a query in Mysql and change the cvor of a piece of text if a specific string is contained in the text.
For example: My tah td returns a text
<td id="conteudo" class="tablesaw-priority-5 tablesaw-cell-visible>{{$value->conteudo}}</td>
If this returned text has any substring for example: XXXX
I need this XXXX to be in red and the rest in the original color in black.
It is possible to accomplish this?
The substring that needs to change color is default, that is, it will always be the same text?
– Andre
No @Andre text changes according to the SELECT output in the database. But the color can always be the same.
– Lorena
And words that have the term should also be highlighted? For example, when searching for "typed", the word "constipated" should be highlighted as having "typed"?
– Woss
not necessary, only the same code.
– Lorena
you are using some framework or template engine? (Blade, Twig...)
– RFL
@Lorena But the code changes depending on the answer.
– Woss
This is done in PHP or Javascript?
– novic