Output Spacer Using PHP
Here’s a neat way to output a spacer image using PHP. I would assume that it is faster that using imagecreatefrompng(), imagepng(), and other image functions. The reason that I like using it is just because it takes fewer lines of code. The following was coded by myself, though inspired from another script, which I couldn’t find :-/. It is great for scripts that deal with outputting images; If an error occurs, just output a spacer using this code.
header("Content-type: image/png");
echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABnRSTlMA/wD/AP83WBt9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAADElEQVR42mP4//8/AAX+Av4zEpUUAAAAAElFTkSuQmCC');