Skip to content

Instantly share code, notes, and snippets.

@pettazz
Created March 13, 2017 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pettazz/15cd6a3263201759acbdcdc71941cbd5 to your computer and use it in GitHub Desktop.
Save pettazz/15cd6a3263201759acbdcdc71941cbd5 to your computer and use it in GitHub Desktop.
png image from hex string
<?php
$data = 'blah';
$data = hex2bin($data);
header('Content-Type: image/png');
imagepng(imagecreatefromstring($data));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment