Last active
September 7, 2018 19:31
-
-
Save seanbuscay/bd08a19b64fcdd2471c1 to your computer and use it in GitHub Desktop.
Get the first sentence in a string.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function firstSentence($string) { | |
$sentences = explode(".", $string); | |
return $sentences[0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment