svn: /phpdoc/en/trunk/reference/url/functions/ get-headers.xml
| From: | Nikita Popov | Date: | Sat, 17 Sep 2011 14:34:06 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/url/functions/ get-headers.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-8824@lists.php.net to get a copy of this message | ||
nikic Sat, 17 Sep 2011 14:34:06 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=316915
Log:
Add get_headers with HEAD example
Changed paths:
U phpdoc/en/trunk/reference/url/functions/get-headers.xml
Modified: phpdoc/en/trunk/reference/url/functions/get-headers.xml
===================================================================
--- phpdoc/en/trunk/reference/url/functions/get-headers.xml 2011-09-17 14:33:35 UTC (rev 316914)
+++ phpdoc/en/trunk/reference/url/functions/get-headers.xml 2011-09-17 14:34:06 UTC (rev 316915)
@@ -126,6 +126,25 @@
]]>
</screen>
</example>
+ <example>
+ <title><function>get_headers</function> using HEAD example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+// By default get_headers uses a GET request to fetch the headers. If you
+// want to send a HEAD request instead, you can do so using a stream context:
+stream_context_set_default(
+ array(
+ 'http' => array(
+ 'method' => 'HEAD'
+ )
+ )
+);
+$headers = get_headers('http://example.com');
+?>
+]]>
+ </programlisting>
+ </example>
</para>
</refsect1>