开发者

Generating Bitmap to - BLOB

Is it possible to generate a BLOB string of a bitmap image which using PHP ? .. im not telling about storing the BLOB in database .. i just required to directly generate a BMP -> BLOB 开发者_开发技巧


Sure. If I understand correctly, you could just load up the image with file_get_contents() to grab its raw data. According to the linked docs, that function is binary-safe.

$bmpblob = file_get_contents('path/to/file.bmp');

To "print" its content to the user, you'd want to issue the correct type header before it. I think it would be something like this:

<?php
$bmpblob = file_get_contents('path/to/file.bmp');

header('Content-type: image/bmp');
echo $bmpblob;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜