Advertisements

image_hwstring

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

Advertisements

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:

WordPress.com Logo

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

Google+ photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s

%d bloggers like this: