研究发现,做什么,我想要的功能,让我分享:
function download_images_for_page($target)
{
echo "target = $target\n";
# Download the web page
$web_page = http_get($target, $referer="");
# Update the target in case there was a redirection
$target = $web_page['STATUS']['url'];
# Strip file name off target for use as page base
$page_base=get_base_page_address($target);
# Identify the directory where iamges are to be saved
$save_image_directory = "saved_images_".str_replace("http://", "", $page_base);
# Parse the image tags
$img_tag_array = parse_array($web_page['FILE'], "");
if(count($img_tag_array)==0)
{
echo "No images found at $target\n";
exit;
}
# Echo the image source attribute from each image tag
for($xx=0; $xx
每个URL引用只有一个资源。 “网址”上没有多个图片。 – mario 2011-01-12 10:42:43