Skip to content

Instantly share code, notes, and snippets.

@seanbuscay
Last active September 7, 2018 19:31
Show Gist options
  • Save seanbuscay/bd08a19b64fcdd2471c1 to your computer and use it in GitHub Desktop.
Save seanbuscay/bd08a19b64fcdd2471c1 to your computer and use it in GitHub Desktop.
Get the first sentence in a string.
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