Is there anyway to convert image url to base64. my current code looks like this.
$path = 'https://projectstaging.s3.ap-southeast-2.amazonaws.com/2ade1776f74aa967de6578bbbceca692c274aced.png';
$type = pathinfo($path, PATHINFO_EXTENSION);
$data = file_get_contents($path);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
I don't want to use file_get_contents as it blocks when there is too many request and this fails. Any better alternative. Thanks