foreach ($conv as $att=>$stl) {
$pattern = '/\b' . preg_quote($att, '/') . '=([\'"])?(.+?)(?(1)\1|(?:$| ))/i';
if (preg_match($pattern, $attributes, $matches)) {
$attributes = preg_replace($pattern, '', $attributes);
$val = $matches[2];
if ($att == 'cellspacing' && strpos($style, 'border-collapse') === false) {
foreach ($conv as $att=>$stl) {
$pattern = '/\b' . preg_quote($att, '/') . '=([\'"])?(.+?)(?(1)\1|(?:$| ))/i';
if (preg_match($pattern, $attributes, $matches)) {
$attributes = preg_replace($pattern, '', $attributes);
$val = $matches[2];
if ($att == 'cellspacing' && strpos($style, 'border-collapse') === false) {