php - Allowing for muli-word search and not forcing the user to deliminate by comma -
i working on small project few friends, , in charge of of php code. have semi-working website in can input recipe ingredients , find full recipe create.
the problem having allowing user input multiple word ingredients (brown sugar, angel hair pasta, etc.) without forcing them use comma delimiter.
i using every invalid character delimit (spaces, commas, numbers, etc.), allow 1 word ingredients searched.
i have thought possibly creating array of ingredients , checking see if user's input match of , pick them out, not sure if best solution.
how javascript based solution there text box. when begin type, pops text box below, suggesting can separate multiple ingredients. name them "ingredients[]" $_post['ingredients'] array in php , can iterate through them.
easier solution have done, separate spaces, comma, etc , rank search results how many of keywords match ingredients list.
Comments
Post a Comment