Here's my problem. I'm making a custom article submission script that outputs a certain article/page of article based upon the URL.
Like this:
http://www.zikes.com/articles/dawncheese/page3
It would output article "dawncheese" and page 3 of that article. My problem is this. The entire body of the article is put into one variable ($body) and inside $body, a user puts [page] to indicate a new page. On my output code, it breaks apart $body by the [page] break.
So I want my script to output the correct $page_array "piece" (created by breaking apart $body) by taking the URL and finding what page the viewer is on.
The problem is this. The only way I know how to do this is by comparing the URL to every possible possibility for the page. Like this:
if($url_specific=='page1')
{
$body = $page_array[0];
}
elseif($url_specific=='page2')
{
$body = $page_array[1];
}
Etc... because some articles could have many pages, I don't want to create a huge list of if/elseif statements to cover all possibilities.
Is there a better way of doing this??????