I have a text file that contains the products on my site in it. I am building a site search script and am running into problems. One of the products on my site are books. I have the summary of the book in the file. I get the summary pulled out of the file fine and get each word separated into an array fine. My problem is that if there is more than one of the same word in the array it displays the same product however many times the word is found. Obviously, I do not want this to happen. Does anyone know of a way I could keep track of which products have already been displayed? I have a unique product ID number at the beginning of each record. I was thinking about using that in some fashion, but cannot come up with a way to achieve this. I am using foreach loops because the number of words obviously varies from book to book. Below is what a record in the file would look like. Thank you for any advice/tips you can give.
ProductIDŠPriceŠTitleŠAuthorŠDescription
D O N