Reputation: 509
I'm reading a rss feed and I get an image url and now I want to store this image in my folder. For this I'm using
$image=$movies->channel->item[i]->medium_image_url;
when I
echo $image
then I put I $url
$url = '$image';
$img = 'images/'.time().'.'.'jpg';
file_put_contents($img, file_get_contents($url));
and I
echo $url its show only $image;
and I found a error
Warning: file_get_contents($image) [function.file-get-contents]: failed to open stream:
No such file or directory in D:\wamp\www\test_om\rss\rssfeed.php on line 36
How can I store this image?
Upvotes: 0
Views: 673
Reputation: 3558
I think the error is here:
$url = '$image';
Remove the quotes and try this instead:
$url = $image;
Upvotes: 3