create single pixel transparent image using php

The below is how to create a PHP that will return an image stream of one transparent dot (PNG or GIF)

 

u can create a transparent 1×1 PNG:

header(‘Content-Type: image/png’);
echo base64_decode(‘iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=’);

 

also u can create a Transparent 1×1 GIF:

header(‘Content-Type: image/gif’);
echo base64_decode(‘R0lGODlhAQABAJAAAP8AAAAAACH5BAUQAAAALAAAAAABAAEAAAICBAEAOw==’);

 

 

enjoy 😉

shenno