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;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.