NYCPHP Meetup

NYPHP.org

[nycphp-talk] Displaying images from a database

csnyder chsnyder at gmail.com
Sat Apr 23 01:02:20 EDT 2005


<?php
function hex2bin($data)
{
   $len = strlen($data);
   return pack("H" . $len, $data);
}


$contents = file_get_contents(
'http://catabase.krook.org/inc/util/view-photo.php?catId=34' );
header('Content-Type: image/jpeg' );
print hex2bin( $contents );


-- 
Chris Snyder
http://chxo.com/



More information about the talk mailing list