Cutting off text, adding it to another file... How?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Cutting off text, adding it to another file... How?

Post by Jim »

Hey all.

Here's my question:

I've created a CMS that allows users to add articles to a site through a webpage. Big whoop, right? What I'd like to do is set a limit for the number of characters per page when the file is generated.

For instance... if a review is 3000 characters long and I want each page to have 1500 of the characters on each, this is how it would look:

Page 1 : 1500 characters of text
Page 2: 1500 characters of text

I'd like the files created for this review to be named /reviewname(page number).php

i.e: http://site.com/reviews/thisgame1.php
http://site.com/reviews/thisgame2.php

And I'd like links to autogenerate at the bottom of each page of this script to link to each page of the review.

Sorry if this seems like a "do this for me please" question. I just really don't have any clue how to go about it.

I'm not looking for a complete solution, just a push in the right direction.

Much thanks for your help!
Post Reply