PHP Explode using a space but how to find two word matches -
For a news script, I want to recognize the content of the artist about the user, so if they mention an artist So I want to put it in an external database and when a person sees the article, they can see the articles that are reading the article. But I have a creativity problem that keeps me back. I use an explosion function to isolate the words:
function multiexplode ($ delimiters, $ string) {$ ready = str_replace ($ delimiters, $ delimiters [0], $ String); $ Launch = explosion ($ delimiter [0], $ ready); Return $ launch; } $ Pieces = multi-explode (arrays (",", ".", "|", ":", "", "", "& Gt;", ""), $ _POST ['article_content']) ;
So if I have mentioned artist Afrozak for example, then I can get it back in the array of pieces. Works well but there is a problem. If for example the user mentions Nikki Romero, the artist is spread over two arrays and I probably can not find it in my database full of artists. So I thought of looking through two words, three words and everything, but I think that should be the simplest way. So my question is, how can I fix this problem that the script can only find PVC artists?
Comments
Post a Comment