Re: Include images in php file

From: Date: Tue, 03 Jul 2007 06:25:25 +0000
Subject: Re: Include images in php file
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-258084@lists.php.net to get a copy of this message
On Thu, June 28, 2007 8:39 am, Marek wrote: > It's not really a limitation but a personal goal. > > I develop a small public script that is meant to be very compact and > portable. All of its functionality fits nicely in one php file. But at > the moment it requires a bunch of tiny icons. I would like to > eliminate > this and just have a single file. But without ruining the graphical > interface. > > So far the best solution i just came up with is to have two files - > one > would be an image with all the icons and i could use css to display > the > right icon. Write a PHP script that takes each icon and appends it as PHP code such as: <?php //my little library here ?> <?php define('ICON1', 'GIF89a47BA73266C887EDFE...');?> You can then have functions that spit out ICON1 or whatever as needed. It will be kind of like writing your own Makefile for PHP source, only not... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#258084) next »