I'm trying to figure out a way to see if user entered search term relates to anything in the $propertyData
array.
So far I have used in_array()
function, but to my understanding it will only match if user entered search term matches array field exactly e.g. User entered "This is a house" and it matches first field in an array wich is "This is a house", but if user enters "This is a" or "a house" it will not match, even though these words are present in that field.
if(in_array($getSearch, $propertyData)) {
// $getSearch is user input
// $propertyData is array containing fields
}
Is there a function / way that can be used to achieve a task?