how to get image width and height from img
style
? for example:
$str = '<img style="margin-right:10px;width:37px;border:0;" src="icons/icon.png">';
How to get width => 37px?
I think if we write a width in a style attr, we could write it like these:
style="width:37px;"(no space with semicolon)
style="width: 37px;"(space with semicolon)
style="width:37px"(no space no semicolon)
style="width: 37px"(space no semicolon)
if no semicolon, the width must be write in the end of the style, like style="height:25px;width:37px"
so how to do it more easier? regex or dom? Thanks.