Find word and append provided HTML tag around word.
If you use composer, you can add this package by running
composer require galiteintechnologies/html-tag-appendar
<?php
use HtmlTagAppendar\StringTagAppendar;
$stringTagAppendar = new StringTagAppendar();
$content = "This content has some dummy text. I want to highlight dummy text with bold tag.";
$result = $stringTagAppendar->appendAround($content, "dummy", "<b>");
This content has some <b>dummy</b> text. I want to highlight <b>dummy</b> text with bold tag.
Pull requests are always welcome.