查找用户搜索是否在任何数组字段的一部分内

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?

Try preg_grep(). It searches an array by regular expression and returns an array of values that matched the expression. So if anything other than an empty array is returned it is considered true:

if(preg_grep("/$getSearch/", $propertyData)) {

For case insensitive add the i modifier:

if(preg_grep("/$getSearch/i", $propertyData)) {

If you want an array of all of the values that matched (if more than 1) also, then:

if($matches = preg_grep("/$getSearch/i", $propertyData)) {

Use array_filter() in conjunction with strpos() scan your array for partial matches of the search-string and return items where a match is found:

$result = array_filter($array, 
    function ($item) use ($getSearch) {
        return (strpos($item, $getSearch) !== FALSE);
    },
$propertyData);

Alternatively, you could use preg_grep() as suggested in AbraCadaver's answer. It returns an array consisting of the elements of the input array that match the given pattern. The regular expression needs to be enclosed in delimiters. I've used / below:

// escape search pattern to allow for special characters
$searchPattern = preg_quote($getSearch, '/');

if ($arr = preg_grep("/$searchPattern/", $propertyData)) {
    print_r($arr);
    // ...
}

You can use something like this:

$found = FALSE;
foreach($propertyData as $property) {
    if(strpos($userQuery, $property)) {
        $found = TRUE;
        break;
    }
}

However, if $propertyData grows, this solution will get slow. Then you could use a database for this.

Use:

foreach($propertyData as $data )
{
    if( strpos($data, $getSearch) )
    {
        //match found
    }
}