21,887
社区成员
发帖
与我相关
我的任务
分享
<?php
if(file_exists('a.jpg')){
$exif = exif_read_data('a.jpg', 0, true);
foreach ($exif as $key => $section) {
foreach ($section as $name => $val) {
echo "$key.$name: $val<br />\n";
}
//print_r($exif);
}
echo '<br /><br />';
}
else{
echo 'Unable to open file a.jpg.';
}
?>
<?php
if(file_exists('a.jpg')){
ini_set('exif.encode_unicode', 'UTF-8');
$exif = exif_read_data('a.JPG', 0, true);
echo $exif['WINXP']['Title'].'<br />';
echo $exif['WINXP']['Comments'].'<br />';
echo $exif['WINXP']['Author'].'<br />';
}
else{
echo 'Unable to open file a.jpg.';
}
?>
array(14) {
["FileName"]=>
string(5) "a.jpg"
["FileDateTime"]=>
int(1223262591)
["FileSize"]=>
int(4659)
["FileType"]=>
int(2)
["MimeType"]=>
string(10) "image/jpeg"
["SectionsFound"]=>
string(27) "ANY_TAG, IFD0, APP12, WINXP"
["COMPUTED"]=>
array(5) {
["html"]=>
string(24) "width="150" height="184""
["Height"]=>
int(184)
["Width"]=>
int(150)
["IsColor"]=>
int(1)
["ByteOrderMotorola"]=>
int(0)
}
["Title"]=>
string(5) "title"
["Comments"]=>
string(12) "sadfasdfasdf"
["Author"]=>
string(6) "author"
["Keywords"]=>
string(4) "sadf"
["Subject"]=>
string(9) "subscript"
["Company"]=>
string(5) "Ducky"
["Info"]=>
string(1) ""
}
array(14) {
["FileName"]=>
string(5) "a.jpg"
["FileDateTime"]=>
int(1223262591)
["FileSize"]=>
int(4659)
["FileType"]=>
int(2)
["MimeType"]=>
string(10) "image/jpeg"
["SectionsFound"]=>
string(27) "ANY_TAG, IFD0, APP12, WINXP"
["COMPUTED"]=>
array(5) {
["html"]=>
string(24) "width="150" height="184""
["Height"]=>
int(184)
["Width"]=>
int(150)
["IsColor"]=>
int(1)
["ByteOrderMotorola"]=>
int(0)
}
["Title"]=>
string(5) "title"
["Comments"]=>
string(12) "sadfasdfasdf"
["Author"]=>
string(6) "author"
["Keywords"]=>
string(4) "sadf"
["Subject"]=>
string(9) "subscript"
["Company"]=>
string(5) "Ducky"
["Info"]=>
string(1) ""
}
if(file_exists('a.jpg')){
$exif = exif_read_data('a.jpg', 'IFDO', false);
echo $exif['DateTime'].'<br />';
echo $exif['Title'].'<br />';
echo $exif['Comments'].'<br />';
echo $exif['Author'];
echo '<br /><br />';
}
else{
echo 'Unable to open file a.jpg.';
}
if(file_exists('a.jpg')){
$exif = exif_read_data('a.jpg', 'IFDO', false);
echo $exif['DateTime'].'<br />';
echo $exif['Title'].'<br />';
echo $exif['Comments'].'<br />';
echo $exif['Author'];
echo '<br /><br />';
}
else{
echo 'Unable to open file a.jpg.';
}
if(file_exists('a.jpg')){
ini_set('exif.encode_unicode', 'UTF-8');
$exif = exif_read_data('a.JPG',0, true);
echo $exif['EXIF']['DateTimeOriginal'].'<br />';
echo $exif['WINXP']['Title'].'<br />';
echo $exif['WINXP']['Comments'].'<br />';
echo $exif['WINXP']['Author'].'<br />';
}
else{
echo 'Unable to open file a.jpg.';
}
$exif = exif_read_data('1111.jpg', "IFD0");
array(12) {
["FileName"]=>
string(8) "1111.jpg"
["FileDateTime"]=>
int(1222482296)
["FileSize"]=>
int(209337)
["FileType"]=>
int(2)
["MimeType"]=>
string(10) "image/jpeg"
["SectionsFound"]=>
string(20) "ANY_TAG, IFD0, WINXP"
["COMPUTED"]=>
array(5) {
["html"]=>
string(24) "width="998" height="749""
["Height"]=>
int(749)
["Width"]=>
int(998)
["IsColor"]=>
int(1)
["ByteOrderMotorola"]=>
int(0)
}
["Title"]=>
string(5) "huo22"
["Comments"]=>
string(6) "huo555"
["Author"]=>
string(8) "huo66666"
["Keywords"]=>
string(6) "huo444"
["Subject"]=>
string(5) "huo33"
}