The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I can use the text [PAGEBREAK] in each article to split the page up into different pages. But instead of using the "Continue to Next Page" text, I want to be able to specify what text to use in each link to the next page.

In a previous post, Karl posted the following:

----------------------------------------
Like Chris said you can use [PAGEBREAK] for the page breaks, if you want to give each page a different name to page 1, page 2 etc. then you could use [PAGEBREAK=NameOfNextPage] and use a regular expression to split the page up and give you the name of the next page.
----------------------------------------

Can someone tell me what a regular expression is and how I am supposed to use that to do what I am wanting to do? I already got it to split up the article into different pages.

Looks good to me, Pedro! It's incredibly rewarding to see people expanding on the code I've presented. It really convinces me that I've provided you with new skills, rather than just code fragments for you to cut and paste!

Am I correct in saying that what the lines above do is this: It looks for the "[NEXTPAGE]", while $numpages counts how many [NEXTPAGE]s there are, ie how many pages there are. It then seperates $fulltext into arrays with one page in each array. Am I wrong?

Secondly, how do I go from here to making the list of links?
I didnt really understand the bits later on in the thread.