在codeigniter中突出显示textarea中的文本

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();.

You have to include jQuery highlightTextarea plugin.

And try like this:

<textarea cols="50" rows="5">Lorem ipsum hello  </textarea>

<script>
  $('textarea').highlightTextarea({
    words: ['Lorem ipsum', 'vulputate']
  });
</script>