/ Published in: PHP
A simple function that will split a given string into sentences, and then return the number of sentences specified. Quick and dirty.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* @param: $len - number of sentences to return @param: $content - string to be returned */ function limit_sentences($len, $content){ $o = null; for($i=0;$i<$len;$i++){ $o.= $content[$i] . '. '; } return $o; }