On Wed, 2004-02-04 at 09:00, Daniel Perez Clavero wrote:
> To Extract the first 50 words, should I use str_word_count, and
> explode/implode or there�s another way, much simple.
>
> Any sample would be apreciated.
> Regards
Regular expressions should do the trick:
$extract = array();
preg_match('/^(\W*\w+){50}/', $paragraph, $extract);
$extract = array_shift($extract);
--
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php