Forum Moderators: coopster

Message Too Old, No Replies

Display results from text file in multiple pages

         

pathwaygr

9:04 am on Sep 14, 2007 (gmt 0)

10+ Year Member



Hello,
i use a string, eg "&&&" to mark pages in a text file.
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

joelgreen

10:03 am on Sep 14, 2007 (gmt 0)

10+ Year Member



$text = file_get_contents("filename.txt");

$pages = explode("&&&", $text);

// Now $pages is an array, containing pages
foreach($pages as $pgnum=>$pgtext) {
echo "<hr>Page #{$pgnum}".$pgtext;
}

pathwaygr

12:55 pm on Sep 14, 2007 (gmt 0)

10+ Year Member



Thank you

eelixduppy

1:00 pm on Sep 14, 2007 (gmt 0)



Hey, welcome to WebmasterWorld, pathwaygr! :)