Definition:
function image_hwstring($width, $height) {}
Retrieve width and height attributes using given width and height values.
Both attributes are required in the sense that both parameters must have a value, but are optional in that if you set them to false or null, then they will not be added to the returned string.
Parameters
- int|string $width: Optional. Width attribute value.
- int|string $height: Optional. Height attribute value.
Return values
returns:HTML attributes for width and, or height.
Source code
function image_hwstring($width, $height) { $out = ''; if ($width) $out .= 'width="'.intval($width).'" '; if ($height) $out .= 'height="'.intval($height).'" '; return $out; }
1991
No comments yet... Be the first to leave a reply!