解决方案 »

  1.   

    $html = <<<html
    <div class="gif-box">
    <img src="http://www.ke6.com/wp-content/uploads/2014/02/hbzy1.jpg" alt="hbzy" width="60" height="60" class="alignnone size-full wp-image-2100" />
    <div class="gif-loading-box">
    <i class="gif-loading" style="display:none;"></i>
    <i class="gif-play"></i>
    </div>
    </div>
    html;
    $regImg = preg_match_all('/<img src=\"(.*?)\" alt=\"hbzy\" width=\"60\" height=\"60\" class=\"alignnone size-full wp-image-2100\" \/>/', $html, $matches) ;
    $newSrc = $matches[1][0].'!static"'." _src=\"".$matches[1][0]."!static\" tsrc=\"".$matches[1][0];
    $html = str_replace($matches[1][0], $newSrc, $html);
    var_dump($html);
      

  2.   

    http://www.tantengvip.com/2014/02/preg-match-html/
    Click here