note 53817 rejected from function.getimagesize by mazzanet
| From: | mazzanet@php.net | Date: | Tue, 14 Jun 2005 10:31:05 +0000 |
| Subject: | note 53817 rejected from function.getimagesize by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-90404@lists.php.net to get a copy of this message | ||
Note Submitter: aleshru at gmail dot com
----
It's a simple function, that return a valid xhtml code width size and heigth ( because in xhtml
attribute height is invalid )
<?
function _getImageSize( $img ) {
list($width, $height, $type, $attr) = getimagesize($img);
$attr = "style=\"width: ".$width."px; height:
".$height."px;\"";
return
array('0'=>$width,'1'=>$height,'2'=>$type,'3'=>$attr);
}
?>