Display results from text file in multiple pages

Discussion in 'PHP' started by pathwaygr, Sep 14, 2007.

  1. #1
    Hello,
    i use a string, eg "&&&" to mark pages in a text file.
    i use $count to count the above string.
    how can i display the contents of this file in multiple pages (by identifying the above string or any other method)?

    Thank you in advance

    John
     
    pathwaygr, Sep 14, 2007 IP
  2. tamen

    tamen Peon

    Messages:
    182
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use $text = explode('&&&', $wholetext); to get the text into an array with the text for each page in its own variable. then have the script check what page it should be showing and show that part of the array.

    Call the page with, say, page.php?page=2 and do an echo $text[$_GET['page']];
     
    tamen, Sep 14, 2007 IP
  3. pathwaygr

    pathwaygr Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you, think i've done it
     
    pathwaygr, Sep 14, 2007 IP
  4. tamen

    tamen Peon

    Messages:
    182
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Good to hear :)
     
    tamen, Sep 15, 2007 IP