Example #1
0
function html_words($html, $count)
{
    $html = strip_tags($html);
    $len = strlen($html);
    $html = substr_words($html, $count);
    if (strlen($html) < $len) {
        $html .= '&hellip;';
    }
    return $html;
}
 function testSubstrWordsEndSep()
 {
     $sentence = 'The quick brown ';
     $four_words = substr_words($sentence, 4);
     $this->assertEquals($four_words, 'The quick brown');
 }