Forum Moderators: coopster
<a class="test"></a> - this would be removed
<a class="test">content</a> - this would not be removed
I have been playing with regular expressions attempting to do this with no luck thus far. Below is my effort:
$content = "<a></a><b>non-empty</b>";
$pattern = "/<[^\/>]*>([\s]?)*<\/[^>]*>/";
echo preg_replace($pattern, '', $content);
If anyone could assist, it would be appreciated.
Thanks.