By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 938 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

splitting text into pages

P: n/a
I'm building a site where I need to pull very large blocks from a database.

I would like to make navigation a little more user friendly by splitting
text in pages which can then be navigated. I know how to split a string in
chunks, but I need to find a method to make sure the text isn't split in the
middle of a word.

Any ideas?

Thanks,
..soma
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"somaBoy MX" <no**@nonesuch.net> wrote in message
news:40**********************@news.skynet.be...
I'm building a site where I need to pull very large blocks from a database.
I would like to make navigation a little more user friendly by splitting
text in pages which can then be navigated. I know how to split a string in
chunks, but I need to find a method to make sure the text isn't split in the middle of a word.

Any ideas?

Thanks,
.soma


string wordwrap ( string str [, int width [, string break [, boolean
cut]]]);

HTH
Garp
Jul 17 '05 #2

P: n/a
On Tue, 30 Mar 2004 17:13:58 +0200, "somaBoy MX" <no**@nonesuch.net> wrote:
I'm building a site where I need to pull very large blocks from a database.

I would like to make navigation a little more user friendly by splitting
text in pages which can then be navigated. I know how to split a string in
chunks, but I need to find a method to make sure the text isn't split in the
middle of a word.


The \b pattern match ('word boundary') of preg_match might be of use.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #3

P: n/a
somaBoy MX wrote:
I'm building a site where I need to pull very large blocks from a database.

I would like to make navigation a little more user friendly by splitting
text in pages which can then be navigated.
Commendable, I think.
I know how to split a string in chunks, but I need to find a method to make
sure the text isn't split in the middle of a word.


Just as it is mid-word, it'd be peculiar to split the text mid-
sentence or mid-paragraph; splitting mid-passage or mid-chapter may
be less off-putting for readers. Don't split up a single train of
thought. How to split the text depends on how it's marked-up.

--
Jock
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.