Return to Snippet

Revision: 18874
at October 11, 2009 10:12 by jnbn


Initial Code
$images = array();
preg_match_all('/(img|src)=("|')[^"'>]+/i', $data, $media);
unset($data);
$data=preg_replace('/(img|src)("|'|="|=')(.*)/i',"$3",$media[0]);
foreach($data as $url)
{
	$info = pathinfo($url);
	if (isset($info['extension']))
	{
		if (($info['extension'] == 'jpg') ||
		($info['extension'] == 'jpeg') ||
		($info['extension'] == 'gif') ||
		($info['extension'] == 'png'))
		array_push($images, $url);
	}
}

Initial URL

                                

Initial Description

                                

Initial Title
Get all images from a HTML document

Initial Tags

                                

Initial Language
PHP