mime_content_type
laravel/framework
Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Detect MIME Content-type for a file
mime_content_type
(
resource
|
string $filename
):
string
|
false
$this
->
assertSame
(
20
,
$info
[
1
]);
$this
->
assertSame
(
'image/jpeg'
,
mime_content_type
(
$jpg
->
getRealPath
())
);
}
tests/Http/HttpTestingFileFactoryTest.php
$this
->
assertSame
(
'image/gif'
,
mime_content_type
(
$image
->
getRealPath
())
);
}
tests/Http/HttpTestingFileFactoryTest.php
$this
->
assertSame
(
'image/webp'
,
mime_content_type
(
$image
->
getRealPath
())
);
}
tests/Http/HttpTestingFileFactoryTest.php
$imagePath
=
$image
->
getRealPath
();
$this
->
assertSame
(
'image/x-ms-bmp'
,
mime_content_type
(
$imagePath
));
$this
->
assertSame
(
'image/bmp'
,
getimagesize
(
$imagePath
)[
'mime'
]);
}
tests/Http/HttpTestingFileFactoryTest.php