Optimized php check

Why not just strpos($ext, 'ph') || strpos($ext, 'htm') || strpos($ext, 'cgi') || ... ??
Why strpos instead of strict comparasion?

Maybe 
$extensions_to_check = array('.htm', '.html', ....);

if (array_search($ext, $extensions_to_check)) {
}

??