Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Function to get first sentence
<?php
function first_sentence($content) {
$pos = strpos($content, '.');
return substr($content, 0, $pos+1);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment