⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.exif-read-data.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
📖 第 1 页 / 共 2 页
字号:
     <span class="term"><i><tt class="parameter">arrays</tt></i></span>      <dd>      <p class="para">       Specifies whether or not each section becomes an array. The        <i><tt class="parameter">sections</tt></i> <i>COMPUTED</i>,       <i>THUMBNAIL</i>, and <i>COMMENT</i>        always become arrays as they may contain values whose names conflict       with other sections.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">thumbnail</tt></i></span>     <dd>      <p class="para">       When set to <b><tt>TRUE</tt></b> the thumbnail itself is read.  Otherwise, only the       tagged data is read.      </p>     </dd>    </dt>   </dl>  </p> </div>     <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   It returns an associative <a href="language.types.array.html" class="type array">array</a> where the array indexes are    the header names and the array values are the values associated with    those headers. If no data can be returned,    <b>exif_read_data()</b> will return <b><tt>FALSE</tt></b>.  </p> </div> <div class="refsect1 changelog">  <h3 class="title">ChangeLog</h3>  <p class="para">   <table class="informaltable">    <colgroup>     <thead valign="middle">      <tr valign="middle">       <th colspan="1">Version</th>       <th colspan="1">Description</th>      </tr>     </thead>     <tbody valign="middle" class="tbody">      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">4.3.0</td>       <td colspan="1" rowspan="1" align="left">        Can read all embedded <acronym title="Image File Directory">IFD</acronym> data including arrays         (returned as such). Also the size of an embedded thumbnail is         returned in a <i>THUMBNAIL</i> subarray, and can         return thumbnails in <acronym title="Tagged Image File Format">TIFF</acronym> format.  Also, there is         no longer a maximum length for returned values (not until the memory         limit has been reached)       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">4.3.0</td>       <td colspan="1" rowspan="1" align="left">        If PHP has  <a href="ref.mbstring.html" class="link">mbstring</a> support,        the user comment can automatically change encoding.  Also, if the        user comment uses Unicode or JIS encoding this encoding will         automatically be changed according to the exif ini settings in         <var class="filename">php.ini</var>       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">4.3.0</td>       <td colspan="1" rowspan="1" align="left">        If the image contains any IFD0 data then COMPUTED contains the entry        ByteOrderMotorola which is 0 for little-endian (intel) and 1 for        big-endian (motorola) byte order.  Also, COMPUTED and UserComment no         longer only contain the first copyright entry if the datatype was         wrong.       </td>      </tr>     </tbody>    </colgroup>   </table>  </p> </div> <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example">    <p><b>Example #1 <b>exif_read_data()</b> example</b></p>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"test1.jpg:&lt;br&nbsp;/&gt;\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$exif&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">exif_read_data</span><span style="color: #007700">(</span><span style="color: #DD0000">'tests/test1.jpg'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'IFD0'</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">$exif</span><span style="color: #007700">===</span><span style="color: #0000BB">false&nbsp;</span><span style="color: #007700">?&nbsp;</span><span style="color: #DD0000">"No&nbsp;header&nbsp;data&nbsp;found.&lt;br&nbsp;/&gt;\n"&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #DD0000">"Image&nbsp;contains&nbsp;headers&lt;br&nbsp;/&gt;\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$exif&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">exif_read_data</span><span style="color: #007700">(</span><span style="color: #DD0000">'tests/test2.jpg'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">"test2.jpg:&lt;br&nbsp;/&gt;\n"</span><span style="color: #007700">;<br />foreach&nbsp;(</span><span style="color: #0000BB">$exif&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$key&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$section</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(</span><span style="color: #0000BB">$section&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$name&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$val</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"$key.$name:&nbsp;$val&lt;br&nbsp;/&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>    <div class="example-contents"><p>     The first call fails because the image has no header information.    </p></div>    <div class="example-contents"><p>The above example will output something similar to:</p></div>    <div class="example-contents"><pre><div class="cdata"><pre>test1.jpg:No header data found.test2.jpg:FILE.FileName: test2.jpgFILE.FileDateTime: 1017666176FILE.FileSize: 1240FILE.FileType: 2FILE.SectionsFound: ANY_TAG, IFD0, THUMBNAIL, COMMENTCOMPUTED.html: width=&quot;1&quot; height=&quot;1&quot;COMPUTED.Height: 1COMPUTED.Width: 1COMPUTED.IsColor: 1COMPUTED.ByteOrderMotorola: 1COMPUTED.UserComment: Exif test image.COMPUTED.UserCommentEncoding: ASCIICOMPUTED.Copyright: Photo (c) M.Boerger, Edited by M.Boerger.COMPUTED.Copyright.Photographer: Photo (c) M.BoergerCOMPUTED.Copyright.Editor: Edited by M.Boerger.IFD0.Copyright: Photo (c) M.BoergerIFD0.UserComment: ASCIITHUMBNAIL.JPEGInterchangeFormat: 134THUMBNAIL.JPEGInterchangeFormatLength: 523COMMENT.0: Comment #1.COMMENT.1: Comment #2.COMMENT.2: Comment #3endTHUMBNAIL.JPEGInterchangeFormat: 134THUMBNAIL.Thumbnail.Height: 1THUMBNAIL.Thumbnail.Height: 1</pre></div>    </pre></div>   </div>  </p> </div> <div class="refsect1 seealso">  <h3 class="title">See Also</h3>  <p class="para">   <ul class="simplelist">    <li class="member"><a href="function.exif-thumbnail.html" class="function" rel="rdfs-seeAlso">exif_thumbnail()</a></li>    <li class="member"><a href="function.getimagesize.html" class="function" rel="rdfs-seeAlso">getimagesize()</a></li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.exif-imagetype.html">exif_imagetype</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.exif-tagname.html">exif_tagname</a></div> <div class="up"><a href="ref.exif.html">Exif Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -