[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
    on Wednesday, July 30, 2003 7:04 PM said:

> ok let me explain , its straight up text content from the database ,
> say its scrolls for ages , i need to split it into pages , so i get
> the length of the string up to the last paragraph which fits i need
> to split it there any idea ?

The primitive, basic way to do this is:

1. grab the entire document and explode it on " "
2. determine how many pages there are
3. display the first page (120 words)
4. on the next page start back at 1 except when you get to #3 go to #5
instead.
5. display the next 120 words by multiplying the page number by 120 and
continuing until pageNumber*120+120. For example, you're on page 2, and
your showing 120 words per page. That would be 2*120+120. Words shown on
page 2 are 240 through 360.
6. continue until all pages are done.

Make sense?


Chris.

p.s. No spaces come before punctuation in English. Sorry to dissapoint
you again.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to