I'm trying to download all the images from an array and store them on my server using PHP.
This is my PHP code:
$IMAGES = 'http://url.com/image.jpg, http://url.com/image2.jpg, http://url.com/image-test.jpg, http://url.com/image6.jpg, http://url.com/image.jpg';
$images = array(''.$IMAGES.'');
foreach($images as $name=>$image) {
$name = explode(",", $image);
$name0 = implode(" ",$name);
copy(''.$name0.'', '/test/'.$name0.'.jpg');
}
When I run my code, I don't get any images stored on my server and I get a warning message on my php page.
Could someone please advise on this issue?
The warning message I get is this:
Warning: copy(/test/http:/url.com/image.jpg http:/url.com/image2.jpg in line 88
and this is on line 88:
copy(''.$name0.'', '/test/'.$name0.'.jpg');