title: Highlight the search keywords on view page returned from mysql query Codeigniter.
body: <p>i'm passing search variable as array to view file where i'm populating description a column from database how would i highlight certain search keywords in my description on view page.</p>
  
  <p>// as my searched keywords are "mobiles in android".</p>
  
  <p>//my returned description row is as // "There are hundreds of mobiles in android."</p>
  
  <p>// how to highlight mobiles and android.</p>
  
  <p>// which are returned from data base what to do with $row['desc'] preg_replace, str_replace tried, imploded the words tried, i replace tried problem not solved.</p>
  
  <p>My Model:</p>
  
  <pre><code>public function anything($tbl){
          $this-&gt;db-&gt;select('*');
          $this-&gt;db-&gt;from($tbl);
          $query = $this-&gt;db-&gt;get();
          return $query-&gt;result_array();
      }
  </code></pre>
  
  <p>My controller :</p>
  
  <pre><code>$search = $this-&gt;input-&gt;get('search');
      $tbl = table;
      $data['search'] = $this-&gt;my_model-&gt;search($tbl, $search); //returned query 
      $this-&gt;load-&gt;view('search-view', $data);
  </code></pre>
  
  <p>View File</p>
  
  <pre><code>foreach ($search as $row) {
  echo = $row['desc'];
  }
  </code></pre>