I tried to highlight specific words in string in textarea using codeigniter. My input is $string=array();
$highlight=array();
foreach($highlight as $k=>$v)
{
foreach($v as $n)
{
$string['word']= highlight_phrase($string['word'], $n, '<span style="color:#990000">', '</span>');
}
}
$data[] ='<div class="Popup"><a href="#megssage" onclick="show_pop(\''.str_replace('\'', '\\\'', $string['words']).'\')"><i class="fa fa-comment-o"></i></a>
<textarea name="txtwords[]" class="PopupText" id="txtwd" readonly="readonly" onDblClick="ToggleReadOnlyState('.$string['id'].')" >'.$string['word'].'</textarea></div>';
I have used the above $string['word']
in text area but instead of highlighted text i am getting output as <span style="color:#990000">Good</span> Articel
Good is the word to be highlighted exists in variable $highlight=array();
.