/ Published in: PHP

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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<img src="path/to/mypic.jpg" <?php $a = @getimagesize("path/to/mypic.jpg"); echo $a[3]; ?> alt="My pic" />
Comments
