In PHP, The hexadecimal image data is displayed on the html img Tag (implementation method ),
A production database of SQLServer2008 of the customer company has been as large as 18 GB for more than a year. It turns out that images in the system are directly stored in the database as hexadecimal strings. I have to use PHP to display it on the html page, and it takes no time.
<? Php // read from the database: The hexadecimal string of the image $ icon_hex = '89504e470d0a1a0a0000000d494844520000001c0000001201030010972c92ca '. 'authorization '. 'authorization '. 'authorization'; $ imgdata = base64_encode (pack ('H * ', $ icon_hex); echo' ';?>
Reference: Convert http://php.net/manual/en/function.imagecreatefromstring.php base64 to image
Note that:When the img label is displayed, you must add the file header Description: "data: image/png; base64,", which has taken me for a long time.
In the above PHP article, the hexadecimal image data is displayed on the img tag of html (implementation method), which is all the content shared by xiaobian. I hope to give you a reference, we also hope that you can support the customer's home.