title: Check for img src keyword in a string
body: <p>I have a blog system where user inputs the image url in the post content like </p>
  
  <pre><code>hey how are you &lt;img src="example.com/image.png"&gt; 
  </code></pre>
  
  <p>if the user has written like this</p>
  
  <pre><code>hello how are you &lt;img src="example.com/image.png"&gt;
  </code></pre>
  
  <p>Then I want to find this <code>img</code> <code>src</code> line and use it as featured image</p>
  
  <p>here is what I have tried:</p>
  
  <pre><code>$haystack = 'how are you &lt;img src="hey.png"&gt;';
  
  $needle = '&lt;img src="';
  
  if (strpos($haystack, $needle) !== false) {
  
      echo "$needle";
  
  }
  else { echo "no"; }
  </code></pre>
  
  <p>When I echo I only get:  </p>
  
  <pre><code> &lt;img src="
  </code></pre>
  
  <p>I want to get whole </p>
  
  <pre><code>&lt;img src="hey.png"&gt; 
  </code></pre>
  
  <p>from that string how can I do this.</p>