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