Skip to content

Instantly share code, notes, and snippets.

@Samuell1
Forked from dkesberg/transparent.php
Last active August 29, 2015 14:14
Show Gist options
  • Save Samuell1/b4c6b8522df39e43414a to your computer and use it in GitHub Desktop.
Save Samuell1/b4c6b8522df39e43414a to your computer and use it in GitHub Desktop.
/**
* source: http://stackoverflow.com/questions/3203354/php-script-to-render-a-single-transparent-pixel-png-or-gif
*/
// transparent 1x1 png
header('Content-Type: image/png');
echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=');
// transparent 1x1 gif
header('Content-Type: image/gif');
echo base64_decode('R0lGODlhAQABAJAAAP8AAAAAACH5BAUQAAAALAAAAAABAAEAAAICBAEAOw==');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment