someting i've used.
At 03:57 PM 8/8/2001 +1100, Justin French wrote:
>Hi all,
>
>I'd like to split a text block at 25 words, as a teaser for the full
>article. Now I know how to split at a certain character, but i don't
>want a half word or anything, so I want (i guess) to hunt for the 25th
7;.', -2);
-> 'mysql.com'
This function is multi-byte safe.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Hope this helps!
Robert V. Zwink
DAID Development LLC
http://www.zwink.net/daid.php
-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Wednes
Thanks to all who replied, this solution by Chris was bar far the
easiest to implement.
Really appreciate it :)
Chris Lambert wrote:
> $teaser = explode(" ", $article, 26));
> array_pop($teaser);
> $teaser = implode(" ", $teaser);
Justin French
--
PHP General Mailing List (http://www.php.n
08, 2001 10:27 AM
Subject: [PHP] splitting text after 25 words
> Hi all,
>
> I'd like to split a text block at 25 words, as a teaser for the full
> article. Now I know how to split at a certain character, but i don't
> want a half word or anything, so I want (i guess) to h
ch <[EMAIL PROTECTED]>
To: php <[EMAIL PROTECTED]>
Sent: Wednesday, August 08, 2001 12:57 AM
Subject: [PHP] splitting text after 25 words
| Hi all,
|
| I'd like to split a text block at 25 words, as a teaser for the full
| article. Now I know how to split at a certain characte
Hi all,
I'd like to split a text block at 25 words, as a teaser for the full
article. Now I know how to split at a certain character, but i don't
want a half word or anything, so I want (i guess) to hunt for the 25th
occurence of " " (a space), and split $text into two new variables,
$text_a
6 matches
Mail list logo