Re: [PHP] Include images in php file



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?

.



Relevant Pages

  • Re: php/html editing help
    ... To do that, wouldn't I have to do the html in a WYSIWYG editor to get the aesthetics, then cut it into a bunch of php print statements? ... I still like the idea of an editor that can compress the presentation into icons for program editing in one view, and compress the logic into icons for presentation editing in another. ...
    (comp.lang.php)
  • Icons dissapears in gnome
    ... after I updated my machine today (dist-upgrade) lots of icons have ... org:ISOTROL, S.A.;XSL / PHP ... title:Programador Senior ...
    (Debian-User)
  • Re: [PHP] Include images in php file
    ... 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. ... 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. ...
    (php.general)