I am looking for a way to insert HTML tags into a string. For example, if I want to highlight part of a user's input how can I wrap it in HTML tags to underline or change its colour?
Example:
User input:
This is an example.
Then I want to hight one word:
This is an example.
I cannot find any string function/s that will do this.
Insert HTML Tags in String
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
substr_replace(), preg_replace() among others can do this.