Sorry guys if its a duplicate, I coudnt find similar topic. So, lets say there is a URL with image content, called "www.test.com/test.jpg". I want to save the image to a folder using php, so I use
file_put_contents('test.jpg', 'www.test.com/test.jpg');
and it is working fine, saving the image to the current folder. However, if the image URL looks like this:
www.test.com/test.jpg?id={1a2b3c-4d5e6f}
I cannot use file_put_contents to save the image. If I try to remove the ?id={1a2b3c-4d5e6f} part, the browser wont open the image. Any ideas how to make the save successful?