Viewing 1 replies (of 1 total)
  • Thread Starter burateen

    (@burateen)

    I solved this problem
    $content = preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<noscript>)?\s*(<\/noscript>)?\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3\4\5', $content);

    What about object and iframe

    $content = preg_replace('/<p>\s*(<object.*>*.<\/object>)\s*<\/p>/iU', '\1', $content);
    	return preg_replace('/<p>\s*(<iframe .*>*.<\/iframe>)\s*<\/p>/iU', '\1', $content);

Viewing 1 replies (of 1 total)
  • The topic ‘Tag P in content’ is closed to new replies.