PHP | exif_tagname() Function Last Updated : 28 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The exif_tagname() function is an inbuilt function in PHP which is used to get the header name for an index. Syntax: string exif_tagname( int $index ) Parameters: This function accepts a single parameter $index which holds the header name. Return Value: This function returns the name of header on success. Below examples illustrate the exif_tagname() function in PHP: Example 1: php <?php for ($i = 0; $i < 300; $i++) { // Get the header $header = exif_tagname($i); if ($header != '') { echo "$i is for " . exif_tagname($i) . '<br>'; } } ?> Output: 11 is for ACDComment 254 is for NewSubFile 255 is for SubFile 256 is for ImageWidth 257 is for ImageLength 258 is for BitsPerSample 259 is for Compression 262 is for PhotometricInterpretation 266 is for FillOrder 269 is for DocumentName 270 is for ImageDescription 271 is for Make 272 is for Model 273 is for StripOffsets 274 is for Orientation 277 is for SamplesPerPixel 278 is for RowsPerStrip 279 is for StripByteCounts 280 is for MinSampleValue 281 is for MaxSampleValue 282 is for XResolution 283 is for YResolution 284 is for PlanarConfiguration 285 is for PageName 286 is for XPosition 287 is for YPosition 288 is for FreeOffsets 289 is for FreeByteCounts 290 is for GrayResponseUnit 291 is for GrayResponseCurve 292 is for T4Options 293 is for T6Options 296 is for ResolutionUnit 297 is for PageNumber Example 2: php <?php $i = 100; $j = 256; // Call to the checker function checkHeader($i); checkHeader($j); // Functiont to check if a header // is defined or not function checkHeader($index) { $header = exif_tagname($index); if($header == '') { echo $index . ': This tag is not defined <br>'; } else { echo $index . ': This tag is for ' . $header . '<br>'; } } ?> Output: 100: This tag is not defined 256: This tag is for ImageWidth Reference: https://www.php.net/manual/en/function.exif-tagname.php Comment More infoAdvertise with us Next Article PHP finfo_file() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-image-functions Similar Reads PHP rename( ) Function The rename() function in PHP is an inbuilt function that is used to rename a file or directory. It attempts to change an old name of a file or directory with a new name specified by the user and it may move between directories if necessary. If the new name specified by the user already exists, the r 3 min read PHP | exif_read_data() Function The exif_read_data() function is an inbuilt function in PHP which is used to read the EXIF headers from an image file. Syntax: array exif_read_data( mixed $stream, string $sections, bool $arrays, bool $thumbnail ) Parameters: This function accepts four parameters as mentioned above and described bel 2 min read PHP | read_exif_data() Function The read_exif_data() function is an inbuilt function in PHP which is used to read the EXIF headers from an image file and is an alternate for exif_read_data(). Syntax: array read_exif_data( mixed $stream, string $sections, bool $arrays, bool $thumbnail ) Parameters: This function accepts four parame 2 min read PHP finfo_file() Function The finfo_file() function is an inbuilt function in PHP that is used for getting information about a file. Syntax: Procedural Style: public finfo_file( string $filename, int $flags = FILEINFO_NONE, ?resource $context = null ): string|false Object-Oriented Style: public finfo::file( string $filename, 2 min read PHP | exif_imagetype() function The exif_imagetype() function is an inbuilt function in PHP which is used to determine the type of an image.Syntax:Â Â int exif_imagetype( string $filename ) Parameters:This function accepts a single parameter $filename which holds the name or URL of the image.Return Value: This function returns an i 1 min read PHP | Gmagick setimagefilename() Function The Gmagick::setimagefilename() function is an inbuilt function in PHP which is used to set the filename of a particular image in a sequence. Syntax: Gmagick Gmagick::setimagefilename( string $filename ) Parameters: This function accepts a single parameter $filename which holds the name of the file. 1 min read Like