[ create a new paste ] login | about

Link: http://codepad.org/oA2rtNP9    [ raw code | output | fork ]

PHP, pasted on Aug 19:
1
2
3
4
5
<?php

$string = ".fdvfbdfbdfvfdvdfv..<h2 style='line-height: 44px;'><p>Lodfvdfvrem Ipsum</p></h2>...fdvbvdfvdfvdfvdfvfbdfbdfbdfb<h1><p>dcsdc</p></h1>";

echo preg_replace('/(<h([1-6])[^>]*>)\s?<p>(.*)?<\/p>\s?(<\/h\2>)/', "$1$3$4", $string);


Output:
1
.fdvfbdfbdfvfdvdfv..<h2 style='line-height: 44px;'>Lodfvdfvrem Ipsum</h2>...fdvbvdfvdfvdfvdfvfbdfbdfbdfb<h1>dcsdc</h1>


Create a new paste based on this one


Comments: