title: get specify word from string php codeigniter
body: <p>I have an input for search ,</p>
  
  <p>i search for "res"</p>
  
  <pre><code>&lt;input type="text" name="search"I/&gt;
  </code></pre>
  
  <p>i use Like method to get search results,</p>
  
  <pre><code>$txt = $this -&gt; input -&gt; post("search");
  $this -&gt; db -&gt; like('title', $txt);
  if ($sql = $this -&gt; db -&gt; get('ads') -&gt; result()) {
              $data['posts'] = $sql;
  
              print_r($sql);
  
          }
  </code></pre>
  
  <p>and get this results : </p>
  
  <pre><code>some text restaurant and other
  some text result
  my resume 
  </code></pre>
  
  <p>i want to show the liked word 
  extract the word from strings and remove other texts</p>
  
  <p>i want this :</p>
  
  <pre><code>restaurant
  result
  resume
  </code></pre>