On Thursday, February 5, 2004, at 02:35 AM, Brian Paulson wrote:
$string = substr($stringname,0,50);
echo $string;
http://www.php.net/substr
No, that's 50 *characters* -- he wanted 50 *words*. A quick and
reasonably accurate[1] solution would be this:
Daniel,
There's a few things you need t
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('
$string = substr($stringname,0,50);
echo $string;
http://www.php.net/substr
That will just give the first 50 characters of the string.
You could just try one of the many suggestions on
http://www.php.net/manual/en/function.str-word-count.php
Scroll down to the user comments and there is
$string = substr($stringname,0,50);
echo $string;
http://www.php.net/substr
Thank You
Brian Paulson
Sr. Web Developer
[EMAIL PROTECTED]
www.chieftain.com
1-800-279-6397 x 207
-Original Message-
From: Daniel Perez Clavero [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 04, 2004 7:
4 matches
Mail list logo