title: How to get image src by class
body: <p>I have this:</p>
  
  <pre><code>&lt;a href="/Dealer-Catalog/ManufacturerID-3"&gt;&lt;img class="brand-logo" src="http://www.teledynamics.com/tdresources/74c42cb2-dc7f-4548-b820-2946fbe160db.jpg" onerror="this.src='/Content/Css/Images/no_brand_logo_120_48.gif'" alt="ADTRAN"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>how to get img src (http://www.teledynamics.com/tdresources/74c42cb2-dc7f-4548-b820-2946fbe160db.jpg)</p>
  
  <p>I try a lot of thinks this was last one:</p>
  
  <pre><code>$doc = new DOMDocument();
  libxml_use_internal_errors(true);
  $doc-&gt;loadHTML($html);
  $xpath = new DOMXPath($doc);
  $src = $xpath-&gt;evaluate("string(//class='brand-logo']/img/@src)");
  echo "$src";
  </code></pre>