This example shows how to display image from string in php gd Library.
This example shows how to display image from string in php gd Library.<?php
$String
= 'iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABl' . 'BMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDr'$String
= base64_decode($String);$image
= imagecreatefromstring($String);if
($image !== false) {header(
'Content-Type: image/png');imagepng(
$image);}
else
{}
?>
After running the program you will get the following output