my php knowledge is basic so could you expand more, thanks
It's not so much a question of PHP knowledge (at this point) as it is deciding what your exact functional requirements are. Do you only want to match exact words, or do you want to match if the search word is contained within a larger word -- or something more complex such as matching only with certain suffixes such as "s", "es", "er", "ed" or "ing"? Should the searching be case-insensitive? Is there some other requirement I haven't thought of?
Once you nail down the exact functional requirements, it's then much easier to come up with an exact coding solution.