There is a picture that is available via http request

https://lh3.googleusercontent.com/nD5tkMTF7z9QHIR8GfDc6BBjPZlH6sAuCvS_nOWsyxi0oPc9OLGq7DRnlOHz-1cRZETPRA=s220

How is it possible to get a picture by running this request in php?

2 answers 2

This is how I did for mp3. Similarly, you can do for pictures

private function saveCallRecord($fileLinks) { $newCallRecordContents = ''; foreach ($fileLinks as $fileLink) { $file = 'http:' . $fileLink . '&download=true'; $newCallRecordContents .= file_get_contents($file); } $file_name = $this->generateString() . '.mp3'; return ['file_name' => $file_name, 'result' => file_put_contents('./media/calls/' . $file_name, $newCallRecordContents)]; } 

    Function copy(url_img, path_save) to help.