I want to turn into
What\'s the pattern for this with regex?
Note: The
The answer from @FtDRbwLXw6 is great although it does not account for spaces. We can extend this regex to include that as well:
$html = preg_replace('#(\s*( )*)+#', '', $html);