To display the first sentence of the paragraph with PHP. Use this code
Code
[php]
function first_sentence($content) {
$pos = strpos($content, ‘.’);
if($pos === false) {
return $content;
}
else {
return substr($content, 0, $pos+1);
}
}
[/php]
Invoke the function like
[php]
echo first_sentence($content);
[/php]