Can you please guide me how can I convert an image from a URL to base64 encoding?
Here is an example using a cURL call.. This is better than the file_get_contents() function. Of course, use base64_encode()
$url = "http://example.com";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
?>