$url = 'http://yoursite.com/image.jpg';
$image = file_get_contents($url);
if ($image !== false){
return 'data:image/jpg;base64,'.base64_encode($image);
}
관련 URL
: https://stackoverflow.com/questions/4343715/php-how-to-convert-an-image-from-url-to-base64
'IT > PHP' 카테고리의 다른 글
Laravel Collection Arr 가져오기 (0) | 2020.04.14 |
---|