$row_text = mysql_fetch_assoc(mysql_query("SELECT text FROM table WHERE id='ид статьи'"));
$mas_text = explode(' ', $row_text['text']);
$rand = mt_rand(0, (count($mas_text)-1));
for($i=$rand-20;$i<$rand;$i++)
{
echo $mas_text[$i].' ';
}
Пробуй х.з. может ошибся где, т.к. с мобилы.