I currently use $output = preg_replace('/>\s+</', "> <", $output) to strip whitespace between any two HTML tags. What can I do to strip whitespace only between paragraph tags. For example, only between </p> and <p> tags?
OK ... Strike all that. I'm going to use PHP's DOMDocument class instead to manipulate the HTML. Soooo here's what I need ... I need to loop through all HTML, and run nl2br() on everything within a <p> tag. Any takers?
Sorry Dani, I'm a bit of a noob at regex...
But my DomDOc is even worse...
$content = "<p>this is your html
with a ]
Change the regex to include paragraph attributes if they are used.