SO you want to output just the sentences with the keywords? And list them underneath a page link, like a google search?
diafol
Keep Smiling
10,666 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,514
Skill Endorsements: 57
Give an example of your input, keyword, and desired output. It would be much easier for us to recommend something.
pritaeas
Posting Prodigy
9,309 posts since Jul 2006
Reputation Points: 1,178
Solved Threads: 1,465
Skill Endorsements: 86
1) Decide how many displays you want per 'page' (record).
2) Search for your keywords in an SQL/DB using MATCH/FULLTEXT?
3) For each record, cut all sentences into lines (using explode on "\n" or ". " or ".\n") - this may will be different if your content is stored in html format.
5) Print the page title
4) Loop through the lines, one at a time, echoing the first say 3 line hits as text in an array, but keep looping to get the total hits number.
5) Echo a last line saying something like 'Displaying 3 out of [27] matches for this page'. Where the 27 is the total number of line hits for that record.
Is that the sort of thing?
Have a go, have a little play. Come back if stuck.
diafol
Keep Smiling
10,666 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,514
Skill Endorsements: 57
Sorry on holiday at the mo, so can't post code v well via mobile. Will be back by sat. In meantime, anybody else?
diafol
Keep Smiling
10,666 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,514
Skill Endorsements: 57