Re: LOGO_GUID
| From: | Christian Schneider | Date: | Thu, 10 Mar 2005 18:25:41 +0000 |
| Subject: | Re: LOGO_GUID | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15360@lists.php.net to get a copy of this message | ||
D . Walsh wrote:
Here's a working solution, build with the command gcc create_php_logo.c -o create-php-logoThe same could be done more easily in PHP in a couple of lines, e.g. #!/usr/bin/php <?php echo "#define CONTEXT_TYPE_IMAGE_GIF \"Content-Type: image/gif\"\n\nunsigned char " . basename($argv[1], ".gif") . "_logo[] = {"; $data = file_get_contents($argv[1]); for ($i = 0; $i < strlen($data) - 1; $i++) {
if ($i % 10 == 0)
echo "\n\t";
printf("%4d,", ord($data{$i}));
}
printf("%4d };\n", ord($data{$i}));
?>
Note: No effort was put into minimizing the program length :-)
- Chris