0 ) { $length = $lastWholeWordPosition; } return mb_substr( $text, 0, $length, $encoding ); } }