Entry
How do I supress HTTP headers?
May 21st, 2001 17:25
Onno Benschop, Nigel Stewart, Ben Udall,
If you are running php from the command line you can use the -q option.
php -q myFile.php3
If you are using it as a module or a cgi from within a server, then
don't output any data.
If you wish to output foreign data, like an image directly from php you
can just output using the header() function:
From the manual:
<?php
Header("Content-type: image/gif");
$string=implode($argv," ");
$im = imagecreatefromgif("images/button1.gif");
$orange = ImageColorAllocate($im, 220, 210, 60);
$px = (imagesx($im)-7.5*strlen($string))/2;
ImageString($im,3,$px,9,$string,$orange);
ImageGif($im);
ImageDestroy($im);
?>