$match = preg_replace('/(<h(1|2|3|4|5|6)[^>]*>)<span[^>]*>(.*)<\/span>(?=(<\/h(1|2|3|4|5|6)>))/','$1$3', '<h2 id="toc-item-1"><span style="font-weight: 400;">Online Doctor Reviews 2020</hs></span></h2>');
return var_dump($match);
Created
September 10, 2020 22:06
-
-
Save huzaifa-a/ca6e0df078fbdf180a8950b104ea435b to your computer and use it in GitHub Desktop.
remove span tag inside a heading
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment