Возможно, что-то подобное может сделать трюк:
<?php $words = implode(' ', array_slice(split($input, ' ', 21), 0, 20));