getting all of the image absolute path in a page?
- by ryanxu
I am trying to get the src of all of the images in a page. But some pages use absolute paths and some do not. So I am wondering whats the best way to do this?
right now I am using this.
$imgsrc_regex = '#<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1#im';
preg_match_all($imgsrc_regex, $html, $matches);