Jump to content

Paging!


lancey10

Recommended Posts

Well, you could use strlen to find the length of your text, then if it exceeds the length that you have determined to be one page, you could use substr to seperate out only that many characters to display, along with a "next page" link.

Of course doing that means that it wouldn't do clean transitions. In other words, if you decided that 10000 characters was one page, and the 10000th character was in the middle of a word, it would cut that word in two.
Link to comment
Share on other sites

[!--quoteo(post=348857:date=Feb 23 2006, 07:16 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Feb 23 2006, 07:16 PM) [snapback]348857[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Well, you could use strlen to find the length of your text, then if it exceeds the length that you have determined to be one page, you could use substr to seperate out only that many characters to display, along with a "next page" link.

Of course doing that means that it wouldn't do clean transitions. In other words, if you decided that 10000 characters was one page, and the 10000th character was in the middle of a word, it would cut that word in two.
[/quote]
is there a script or a tutorial that i can see?
Link to comment
Share on other sites

[a href=\"http://ca.php.net/manual/en/function.str-word-count.php\" target=\"_blank\"]http://ca.php.net/manual/en/function.str-word-count.php[/a] in the manual, and look at the notes provided by webmaster at joshstmarie dot com .. that's what you're asking about.
Link to comment
Share on other sites

a rough sledgehammer approach would be to create some session variables that will track...

1. the original text
2. the page you are on

with those two pieces of information you could calculate which portion of text to display and loop through the original text.

Probably a clumsy way to do it but it sould work til you can refine it.

Lite...
Link to comment
Share on other sites

  • 10 months later...
Wow, this is almost a year old.  Did you ever get it figured out??? 

I have a similar issue where I'm printing several tables.  Each table is in the neighborhood of 40 something lines.  So, when printed, the page breaks break the table into two.  Is there a command you can send to the printer?

Thx.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.