exif_read_data
Function • Params and return types changed in PHP 8.0
Reads the EXIF headers from an image file.
exif_read_data Function synopsis
exif_read_data(
$file,
?string $required_sections = null,
bool $as_arrays = false,
bool $read_thumbnail = false
): array|false
Parameters
$file
$required_sections
OptionalType?stringDefault valuenull
Is a comma separated list of sections that need to be present in file
to produce a result array. If none of the requested
sections could be found the return value is false.
$required_sections accepts one of the following string values:
FILECOMPUTEDANY_TAGIFD0THUMBNAILCOMMENTEXIF
$as_arrays
OptionalTypeboolDefault valuefalse
$read_thumbnail
OptionalTypeboolDefault valuefalse
Return value
Typearray|false
Changes to the exif_read_data Function
PHP 8.0
- Return type added:
array|false - Parameter name of parameter #1 changed:
$filenameto$file - Parameter name of parameter #2 changed:
$sections_neededto$required_sections - Parameter type added for parameter #2 (
$required_sections):?string - Parameter default value added for position #2 (
$required_sections):null - Parameter name of parameter #3 changed:
$sub_arraysto$as_arrays - Parameter type added for parameter #3 (
$as_arrays):bool - Parameter default value added for position #3 (
$as_arrays):false - Parameter type added for parameter #4 (
$read_thumbnail):bool - Parameter default value added for position #4 (
$read_thumbnail):false
exif_read_data(
- $filename,
+ $file,
- $sections_needed,
+ ?string $required_sections = null,
- $sub_arrays,
+ bool $as_arrays = false,
- $read_thumbnail
+ bool $read_thumbnail = false
- )
+ ): array|false exif_read_data Function Availability
exif_read_data Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | Yes |
| PHP 8.3Security-Fixes Only | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Unsupported | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |