Generate a clear 1x1 GIF

Dani 0 Tallied Votes 2K Views Share

This code dynamically generates a clear 1x1 pixel.

<?php

// We'll be outputting a GIF
header('Content-Type: image/gif');

// Generate a clear pixel
$output = base64_decode('R0lGODlhAQABAJAAAP8AAAAAACH5BAUQAAAALAAAAAABAAEAAAICBAEAOw==');

// Spit it out
echo $output;