$subject = preg_replace ("/(\[p\])(.*)(\[\/p\])/i","

\2

",$subject);