php_exif是什么,PHP exif_tagname()用法及代码示例

exif_tagname()函数是PHP中的内置函数,用于获取索引的标头名称。

用法:

string exif_tagname( int $index )

参数:该函数接受单个参数$index,该参数保存标头名称。

返回值:成功时此函数返回标头名称。

以下示例说明了PHP中的exif_tagname()函数:

范例1:

for ($i = 0; $i < 300; $i++) {

// Get the header

$header = exif_tagname($i);

if ($header != '') {

echo "$i is for "

. exif_tagname($i) . '
';

}

}

?>

输出:

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

范例2:

$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
';

} else {

echo $index . ':This tag is for '

. $header . '
';

}

}

?>

输出:

100:This tag is not defined

256:This tag is for ImageWidth

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值