Jump to content

Keywords


Imoddedu

Recommended Posts

Is there a php function or script that looks up specific words in a string? I've done some googling, but I'm not sure which functions to use. Basically my end goal is to search for keywords from a inputted string, and respond with a certain set answer from a MySQL database.

Link to comment
Share on other sites

Is there a php function or script that looks up specific words in a string? I've done some googling, but I'm not sure which functions to use. Basically my end goal is to search for keywords from a inputted string, and respond with a certain set answer from a MySQL database.
If you have several different key words in the same string that you want to match, you may like to consider the str_word_count() function. For with this function you can capture all of the words of a string as individual elements of an array and then match each element of the array separately against key word.It would likely be more cpu intensive, but you might also find it easier to use.Roddy
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...