删除p标签内的html标签,因为我在即时文章中有问题

Facebook doesn't allow one to add another html tags inside p tags.if i am adding it then i am getting below error

General Errors: Empty Articles: You have one or more articles without any content.

if i understand it properly then it is because of adding html tags inside p tags.where Facebook only allows text inside p tags.so can anyone please help me in solving this problem.

examples :

<p><br></p>


<p><figure></figure></p>

</div>

I've only tested this in javascript but I think this should work in PHP too:

$html = '<p><figure></figure></p>';
$var = $html;

do {
    $html = $var;
    $var = preg_replace('(<p\b[^>]*>[^<]*)((?=<\/p>)|<[^>]+>)', '$1', $html);
} while($var != $html)

The only problem with this regex is that it won't properly remove nested <p> tags however these occurring seems unlikely.