<?php if (isset($_GET['url'])) { $typeList = array("unknown","image/gif" ,"image/jpeg" ,"image/png"); list($width,$height,$type) = getimagesize($_GET['url']); $base64 = base64_encode(file_get_contents($_GET['url'])); $img = "data:" . $typeList[$type] . ";base64," . $base64; echo "<xmp style='word-wrap:break-word'>" . $img . "</xmp>"; } ?>
PHP: Image base64 to url (convertire una immagine online su codifica base64)
<?php if (isset($_GET['url'])) { $typeList = array("unknown","image/gif" ,"image/jpeg" ,"image/png"); list($width,$height,$type) = getimagesize($_GET['url']); $base64 = base64_encode(file_get_contents($_GET['url'])); $img = "data:" . $typeList[$type] . ";base64," . $base64; echo "<xmp style='word-wrap:break-word'>" . $img . "</xmp>"; } ?>