Binary safe string comparison of the first n characters
<?php strncmp(string $string1, string $string2, int $length): int
<?php $mime = File::mimeType($path);
}
if ($mime !== null && strncmp($mime, 'image/', 6) !== 0) {
throw new \Exception("Image [{$path}] does not actually appear to be an image.");
}
}