January 24th, 2012, 12:56 PM
Turn left at the third duck
Join Date: Dec 2011
Location: Nelson, NZ
I'd suggest one tiny change from Requinix's suggestion because you want to match a literal period, not a "dot" (any character).
I have tested this php.
Period. Again.One.Word. Hi.5.33
$string='Period. Again.One.Word. Hi.5.33';
echo htmlentities(preg_replace($regex,'.<br /><br />\1',$string));
Period.<br /><br />Again.One.Word.<br /><br />Hi.5.33
The htmlentities is just for display, what you want is the preg_replace.
Let us know if one of those works for you.
Last edited by ragax : January 27th, 2012 at 09:32 PM.
Reason: Inserted space char in the regex