Return to Snippet

Revision: 6056
at April 24, 2008 05:30 by AdrianShort


Initial Code
<img src="path/to/mypic.jpg" <?php $a = @getimagesize("path/to/mypic.jpg"); echo $a[3]; ?> alt="My pic" />

Initial URL

                                

Initial Description
The lazy way to generate XHTML-valid width and height attributes for your images. This is incredibly inefficient, though I believe (ref?) that calls to getimagesize() are cached.

Initial Title
Automatic image width and height tags

Initial Tags
images

Initial Language
PHP