find('object'); if(count($objs)>0){ $res = $objs[0]; } else { $imgs = $html->find('img'); if(count($imgs)>0){ $res = $imgs[0]; } } return $res; } ?>