FUNCTION substr_in_array($haystack, $needle){
$found = ARRAY();
// cast to array
$needle = (ARRAY) $needle;
// map with preg_quote
$needle = ARRAY_MAP('preg_quote', $needle);
// loop over array to get the search pattern
FOREACH ($needle AS $pattern)
{
IF (COUNT($found = PREG_GREP("/$pattern/", $haystack)) > 0) {
RETURN $found;
}
}
// if not found
RETURN FALSE;
}