svn: /phpdoc/en/trunk/reference/stream/functions/ stream-get-meta-data.xml
| From: | Philip Olson | Date: | Fri, 16 Oct 2009 16:05:44 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/stream/functions/ stream-get-meta-data.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-5154@lists.php.net to get a copy of this message | ||
philip Fri, 16 Oct 2009 16:05:44 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=289699
Log:
Added an example, and see also $http_response_header and get_headers()
Changed paths:
U phpdoc/en/trunk/reference/stream/functions/stream-get-meta-data.xml
Modified: phpdoc/en/trunk/reference/stream/functions/stream-get-meta-data.xml
===================================================================
--- phpdoc/en/trunk/reference/stream/functions/stream-get-meta-data.xml 2009-10-16 15:14:06 UTC (rev
289698)
+++ phpdoc/en/trunk/reference/stream/functions/stream-get-meta-data.xml 2009-10-16 16:05:44 UTC (rev
289699)
@@ -164,6 +164,64 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>stream_get_meta_data</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$url = 'http://www.example.com/';
+
+if (!$fp = fopen($url, 'r')) {
+ trigger_error("Unable to open URL ($url)", E_USER_ERROR);
+}
+
+$meta = stream_get_meta_data($fp);
+
+print_r($meta);
+
+fclose($fp);
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+Array
+(
+ [wrapper_data] => Array
+ (
+ [0] => HTTP/1.1 200 OK
+ [1] => Server: Apache/2.2.3 (Red Hat)
+ [2] => Last-Modified: Tue, 15 Nov 2005 13:24:10 GMT
+ [3] => ETag: "b300b4-1b6-4059a80bfd280"
+ [4] => Accept-Ranges: bytes
+ [5] => Content-Type: text/html; charset=UTF-8
+ [6] => Set-Cookie: FOO=BAR; expires=Fri, 21-Dec-2012 12:00:00 GMT; path=/;
domain=.example.com
+ [6] => Connection: close
+ [7] => Date: Fri, 16 Oct 2009 12:00:00 GMT
+ [8] => Age: 1164
+ [9] => Content-Length: 438
+ )
+
+ [wrapper_type] => http
+ [stream_type] => tcp_socket/ssl
+ [mode] => r
+ [unread_bytes] => 438
+ [seekable] =>
+ [uri] => http://www.example.com/
+ [timed_out] =>
+ [blocked] => 1
+ [eof] =>
+)
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
<refsect1 role="notes">
&reftitle.notes;
<note>
@@ -173,6 +231,16 @@
</note>
</refsect1>
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>get_headers</function></member>
+ <member><link
linkend="reserved.variables.httpresponseheader">$http_response_header</link></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
</refentry>
<!-- Keep this comment at the end of the file