Skip to content

Instantly share code, notes, and snippets.

@t-cyrill
Created November 13, 2015 09:09
Show Gist options
  • Save t-cyrill/c363faec8fc490a59e84 to your computer and use it in GitHub Desktop.
Save t-cyrill/c363faec8fc490a59e84 to your computer and use it in GitHub Desktop.
preg_match_any
/**
* preg_match
*
* @param array $patterns preg_matchに渡せるpattern文字列の配列
* @param string $subject 調べる文字列
*/
function preg_match_any(array $patterns, $subject) {
foreach ($patterns as $pattern) {
if (preg_match($pattern, $subject) === 1) return true;
}
return false;
}
@t-cyrill
Copy link
Author

雑い

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment