Good time. I create and display a picture with a phone like this:
header("Content-Type: image/png"); $im = @imagecreate(150, 20)or die("Невозможно создать поток изображения"); $background_color = imagecolorallocate($im, 0, 0, 0); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 4, 2, 2, "+7 111 111 11 11", $text_color); imagepng($im); imagedestroy($im); Further, I need to withdraw it right away, but only on base64. Tell me the logic of my further actions, otherwise I don’t think: you need to copy it to the host and then output it or, without copying, immediately output it so that it doesn’t take up space?
I display other pictures on the host like this:
$file = "../../../../../demo/8.x/test.png"; if($fp = fopen($file,"rb", 0)) { $picture = fread($fp,filesize($file)); fclose($fp); $base64 = chunk_split(base64_encode($picture)); $tag = '<img src="data:image/gif;base64,'.$base64.'" />'; echo $tag; } example: avito
