title: How to extract base64 image from text in laravel?
body: <p>How to extract base64 image from text? I tried to use simple html dom library but couldn't extract it from text. I need to extract each base64 and convert it to an image then save it to public folder.</p>
  <p>Code:</p>
  <pre><code>  $post = \App\Post::find(45);
      $dom = HtmlDomParser::str_get_html( $post-&gt;content );
      foreach ($dom-&gt;find('data:image') as $element) {
          dd($element);
      }
  </code></pre>
  <pre><code>&lt;p style=&quot;text-align:right&quot;&gt; Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to ma&lt;/p&gt;
  
  &lt;p style=&quot;text-align:right&quot;&gt;data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB .... == &lt;/p&gt;
  </code></pre>