<?php
$img = '<img src="test.png" style="float:left;"/>';
preg_match('/<[^>]+ (style=".*?")/i', $img, $match); $result = $match[1];
echo $result;
PD9waHAKCiRpbWcgPSAnPGltZyBzcmM9InRlc3QucG5nIiBzdHlsZT0iZmxvYXQ6bGVmdDsiLz4nOwpwcmVnX21hdGNoKCcvPFtePl0rIChzdHlsZT0iLio/IikvaScsICRpbWcsICRtYXRjaCk7CiRyZXN1bHQgPSAkbWF0Y2hbMV07CgplY2hvICRyZXN1bHQ7