file_exists_ex

include_pathを考慮したfile_existsが流行っているようなので。

function file_exists_ex($path)
{
    $dirs = explode(PATH_SEPARATOR, get_include_path());
    foreach ($dirs as $dir) {
        $abs_dir = realpath($dir);
        if ($abs_dir === false) {
            continue;
        }
        $abs_path = $abs_dir . DIRECTORY_SEPARATOR . $path;
        if (file_exists($abs_path)) {
            return true;
        }
    }
    return false;
}