问题
so iam trying to download images by this code i successfully download the images but they without any data and corrupted
like the images have 0 bytes
function get_chapter_images(){
include('simple_html_dom.php');
$url = 'http://localhost/wordpress/manga/manga-name-ain/chapter-4/';
$html = file_get_html($url);
$images_url = array();
foreach($html->find('.page-break img') as $e){
$image_links = $e->src;
array_push( $images_url, $image_links);
}
return $images_url;
}
$images_links = get_chapter_images();
foreach( $images_links as $image ){
$imag_fliter = str_replace( '?ssl=1', '', $image );
$data = @file_get_contents( $image );
$pathinfo = pathinfo( $image );
$file_name = $pathinfo['basename'];
@file_put_contents("manld/$file_name", $data );
}
来源:https://stackoverflow.com/questions/60595966/i-get-no-data-when-download-images