I have this as part of a preg_replace array
// CENTER ITEMS
$pattern[5] = '/\[center\](.*?)\[\/center\]/i';
$replace[5] = "<div class=\"centerText\">$1</div>";
It works as long as whatever it is finding is like
[center]lol[/center]
But if the text is like
[center]hello
my name is steve
[/center]
It does not work how can I solve this?
Thanks
Add the “s” modifier, which will include newlines in the match text.
http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php