How to detect more than one line break \n in PHP?

Ducati87

New Member
I need to detect more than one \[code\]\n\[/code\]. Doesn't matter if it's 2 or 1000, as long as it's more than one \[code\]\n\[/code\]. What would be the regex for this (if regex is necessary that is)?EDITI am using this:\[code\]$pregmatch = preg_match('#\\n\\n+#', $locations);if ($pregmatch > 0) { echo 'more than one, this many: '.count($pregmatch);} else echo 'less than one';\[/code\]but \[code\]count($pregmatch)\[/code\] doesn't return the actual number of more than one \[code\]\n\[/code\] detected. How can that be achieved?
 
Back
Top