From The Blog

Get the sources of img tags from html

21 October 2013, in

/**
* get the sources of img tags from html input parameter
*/
function get_html_img_sources($html){
//$html = types_render_field( "gallery_image", array( "size" => "medium", "proportional" => "true",'output'=>'raw') );
if(empty($html))
return array();
$doc = new DOMDocument();
$doc->loadHTML($html);
$imageTags = $doc->getElementsByTagName('img');



Post a Comment