in my guestbook entries are stored in a text file could anybody give information or links to articles on how to search text file and display results with pagination
Producing a search engine in php is not the easiest thing to do. You would achieve more functionality if you could store the data in a database and use the excellent full text search capabilities of MYSQL. If you do want to read the contents of the text file you would need to write a script to use the file_get_contents(); command to store the text file as a string and then check for the existance of the search string using strpos or similar.
oh boy, text files dont scale well, databases do anyways if u want to search the textfiles heres pseudo code ------------------ make an array have a loop that opens each tect file at a time, read the contents of each text file into a string add this string into the array once u looped thru all the files, search the array for the word u want ------------------------------
Certainly if you have multiple text files is complicates things somewhat and you need to loop through them as wwm pointed out. I had assumed you had one text file?
how to compare strings in php? in perl it's like this if ($line =~ /pattern/){ } searches $line for a pattern of characters placed within the forward slashes on the right how will it look like in php?