I would like to know what method is good to get the first 20 words from an english sentence. I need to analyze its subject and verb before processing further. Because there are sentences that are useless so I don't need to analyze them, dump them instead :-D
Ok It's always better for the starter to start first (pss is there a proverb or saying that fits well my claim here in English - I am a very active English learner ;-D)
Here you go:
$array=explode($string," ");
$con=$array[0];
$i=0;
foreach($array as $v)
{
if($i++ == 20){break;}
$con.=" ".$v[i];
}
Oh yezzz, Anyone can help with neater function or method please ?