function get_full_sentance($content,$dot='.'){
$content = strip_tags($content);
$position = stripos ($content, $dot); //find first dot position

if($position) { //if there's a dot in our soruce text do
$offset = $position + 1; //prepare offset
$position2 = stripos ($content, $dot, $offset); //find second dot using offset
$first_two = substr($content, 0, $position2); //put two first sentences under $first_two

$first_two = $first_two . '.'; //add a dot
}

else { //if there are no dots
//do nothing
$first_two = $content;
}

return $first_two;

}

Advertisements