<img src="......" width="....." height="...."/>
If I have a function generating the above code, how can I get the width and height attributes with php?
<img src="......" width="....." height="...."/>
If I have a function generating the above code, how can I get the width and height attributes with php?
You can use getimagesize()
<?php
list($width, $height, $type, $attr) = getimagesize("http://example.com/image.gif");
?>
<img src="..." width="<?= $width ?> height="<?= $height ?>" />