/ Published in: PHP

Useful for preparing content generated by CKEditor
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function paragraph_trim($content) { $result = preg_replace('!(^(\s*<p>(\s| )*</p>\s*)*|(\s*<p>(\s| )*</p>)*\s*\Z)!em', '', $content); return $result === NULL ? $content : $result; }
Comments
