login/register

Snip!t from collection of Fiona

see all channels for Fiona

Snip
summary

size.
<?php
list($width, $height, $type, $attr) = getimagesize($_SER ...
echo '<img src="/path_to_image.jpg" '.$attr.' alt="alt t ...
... th and height values in the 'width="x" height="y"' form.

mezzoblue  §  Image Attributes
http://www.mezzoblue.com/archives/2005/05/10/image_attrib/

Categories

/Channels/web/code

[ go to category ]

For Snip

loading snip actions ...

For Page

loading url actions ...

size.

<?php
list($width, $height, $type, $attr) = getimagesize($_SERVER[DOCUMENT_ROOT].'/path_to_image.jpg');
echo '<img src="/path_to_image.jpg" '.$attr.' alt="alt text" />';
?>

The $attr variable automatically stores the width and height values in the 'width="x" height="y"' form.

HTML

<p>size.</p> <p>&lt;?php<br> list($width, $height, $type, $attr) = getimagesize($_SERVER[DOCUMENT_ROOT].'/path_to_image.jpg');<br> echo '&lt;img src="/path_to_image.jpg" '.$attr.' alt="alt text" /&gt;';<br> ?&gt;</p> <p>The $attr variable automatically stores the width and height values in the 'width="x" height="y"' form.</p>