Change the Color of First Few Words PHP

If you have a header or similar and would like the first few words highlighted, here’s a nice little script. In below the class red is defined in my css, and $color would be the number of words I want coloured.

Usage would be similar to:

Leave a Reply

Your email address will not be published.