I like this version so far:
Code:
$string = <<<EOS
Lorem ipsum is the most common form of "Greeking". However more and more people are sick and tired of using the same sample text over and over again. Also lorem ipsum is in latin and it may not always be the best choice. We tried to have text generated in some of the most widely used languages but if you are in desperate need of random text in your own language, send us an email and we'll add it here.
Adding a few extra examples... you mean like this? Hmm, what the hell?!!!
EOS;
preg_match_all( '/[^.?!]+[.?!]+/m', $string, $matches );
$sentences = array_map( 'trim', $matches[0] );
shuffle( $sentences );
$sentences = array_map( 'ucfirst', $sentences );
echo implode( ' ', $sentences );
This kept the mix of punctuation and any number of it together, and in case of a fragment with lowercase first letter it'll fix that.
Outputs:
However more and more people are sick and tired of using the same sample text over and over again. We tried to have text generated in some of the most widely used languages but if you are in desperate need of random text in your own language, send us an email and we'll add it here. You mean like this? Adding a few extra examples... Hmm, what the hell?!!! Lorem ipsum is the most common form of "Greeking". Also lorem ipsum is in latin and it may not always be the best choice.