Hi all,
I've run into a small problem regarding capture of keywords from word documents, getting the sum of the total matches and posting those results to a database. I'm using Antiword to convert the word documents to text files for easy processing. Here's what I've got so far for this part of the function:
PHP Code:
$keywords = importKeywords(); $txtTempfile = $tempfile . ".txt"; system($antiword . " " . $tempfile . " > " . $txtTempfile); $resumeFile = file($txtTempFile); for($i = 0; $i < count($keywords); $i++) { for($j = 0; $i < count($resumeFile); $i++) { if(eregi($keywords[$i],$resumeFile[$j])) { // HERE'S THE CRITICAL AREA OF WHICH I NEED HELP!! $matches[$keywords[$i]]++; } } }
I need a better method of storing the relevant matches and their respective occurances of those matches (e.g. say the keyword "Sous Chef" was found 24 times in a document) I need a way of adding those occurances and storing that in an associative array, so I can iterate through and post the entries to my backend database.
Am I on the right track? If not, what am I missing?
Many thanks in advance.
|