strspn

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask
strspn(    string $string,    string $characters,    int $offset 0,    ?int $length null): int
    public function isAbsolutePath(string $file)

    {

        return 
'' !== $file && (strspn($file'/\\'01)

            || (
\strlen($file) > && ctype_alpha($file[0])

                && 
':' === $file[1]

                && 
strspn($file'/\\'21)
        return '' !== $file && (strspn($file'/\\'01)

            || (
\strlen($file) > && ctype_alpha($file[0])

                && 
':' === $file[1]

                && 
strspn($file'/\\'21)

            )

            || 
null !== parse_url($file\PHP_URL_SCHEME)

        );