In the inline code comments you already note:
// Will be tripped up by "Mr." or "U.K.". Not a major concern at this point.
I found it is also tripped up by ... or ?!
Just wanted to show you the below suggestion for consideration as it will at least provide better count in ... and ?! situations:
$intSentences = max( 1, preg_match_all( '`[^\.!?]+[\.!?]+([\s]+|$)`u', $strText, $matches ) );
In the inline code comments you already note:
// Will be tripped up by "Mr." or "U.K.". Not a major concern at this point.I found it is also tripped up by
...or?!Just wanted to show you the below suggestion for consideration as it will at least provide better count in ... and ?! situations: