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.


  • 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;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: