Can someone write a script which will read my articles and create a file which has all the words in that article. for example say article is. There is a new gadget by abc company with great features like auto reset.... I want a file or a table popuplated with words like There is a new gadget...etc etc ... well you get the idea.
$article = 'There is a new gadget by abc company with great features like auto reset....'; $words = preg_split('/[\s,\.]+/', $article, -1, PREG_SPLIT_NO_EMPTY); $fp = fopen('article.txt', 'w'); fwrite($fp, implode("\n", $words)); fclose($fp); PHP:
Thanks nico. Can someone modify this script to query a mysql table. get the article in a variable. get all the words. insert it into a new table. and do this for each article? Thank you very much.
I am sorry. I should have mentioned that I am willing to pay if some one do this job. anyone? Please PM
You forgot about duplicates And some of the words should not be used... let say 3 or less characters, no? For me seems like a tagging system for articles (if you use count of the words in the new created table) the code it's simple: use the Nico regexp to extract words (in a loop for all articles extracted from database) then foreach word, a simple insert in database. Piece of cake. You can even use the file that's already created, if you change the mod of writing into it from "w" to "a+", and generate insert commands from it