^||', '/(]*>.*?)(\+\++)/', "CellRowspan"); function CellRowspan($m) { $string = $m[1]; $r = strlen($m[2]); return preg_replace('/^(.*<\/t[dh]>)?(]*)(>.*?)$/', '$1$2 rowspan="'.$r.'"$3',$string); } ## rowspan filler Markup('||^^', '<^||||', '/\|\|\^\^+(?=\|\|)/',''); ## colspan filler Markup('||__', '<^||||', '/\|\|__+(?=\|\|)/','||');