From: Anthony Talarico Date: Mon, 23 Nov 2015 20:51:24 +0000 (-0500) Subject: trying another regex to remove extra spaces X-Git-Tag: v1.0.0^2~272^2~4 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=23e0b4d11b812faf0b304d4e57034a4b0e245589;p=WP-Themes%2Fstaffords.git trying another regex to remove extra spaces --- diff --git a/search.php b/search.php index 6a84b80..c25c697 100644 --- a/search.php +++ b/search.php @@ -73,12 +73,12 @@ } // Highlight matches - $context = nl2br(preg_replace('/'.str_replace('/', '\/', join('|', $terms)).'/i', '$0', $output)); - $noNewLine = preg_replace('/[\n\r]+/', '', $context); + $context = nl2br(preg_replace('/'.str_replace('/', '\/', join('|', $terms)).'/i', '$0', $output)); + $noExtraSpace = preg_replace('!\s+!', ' ', $context); ?>

- +