<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >stream_get_meta_data</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Manual do PHP" HREF="index.html"><LINK REL="UP" TITLE="Stream Functions" HREF="ref.stream.html"><LINK REL="PREVIOUS" TITLE="stream_get_line" HREF="function.stream-get-line.html"><LINK REL="NEXT" TITLE="stream_get_transports" HREF="function.stream-get-transports.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual do PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.stream-get-line.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.stream-get-transports.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.stream-get-meta-data" ></A >stream_get_meta_data</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN217178" ></A ><P > (PHP 4 >= 4.3.0, PHP 5)</P >stream_get_meta_data -- Retrieves header/meta data from streams/file pointers</DIV ><DIV CLASS="refsect1" ><A NAME="AEN217181" ></A ><H2 >Description</H2 >array <B CLASS="methodname" >stream_get_meta_data</B > ( resource stream )<BR ></BR ><P > Returns information about an existing <CODE CLASS="parameter" >stream</CODE >. The stream can be any stream created by <A HREF="function.fopen.html" ><B CLASS="function" >fopen()</B ></A >, <A HREF="function.fsockopen.html" ><B CLASS="function" >fsockopen()</B ></A > and <A HREF="function.pfsockopen.html" ><B CLASS="function" >pfsockopen()</B ></A >. The result array contains the following items: </P ><P ></P ><UL ><LI ><P > <CODE CLASS="parameter" >timed_out</CODE > (bool) - <TT CLASS="constant" ><B >TRUE</B ></TT > if the stream timed out while waiting for data on the last call to <A HREF="function.fread.html" ><B CLASS="function" >fread()</B ></A > or <A HREF="function.fgets.html" ><B CLASS="function" >fgets()</B ></A >. </P ></LI ><LI ><P > <CODE CLASS="parameter" >blocked</CODE > (bool) - <TT CLASS="constant" ><B >TRUE</B ></TT > if the stream is in blocking IO mode. See <A HREF="function.stream-set-blocking.html" ><B CLASS="function" >stream_set_blocking()</B ></A >. </P ></LI ><LI ><P > <CODE CLASS="parameter" >eof</CODE > (bool) - <TT CLASS="constant" ><B >TRUE</B ></TT > if the stream has reached end-of-file. Note that for socket streams this member can be <TT CLASS="constant" ><B >TRUE</B ></TT > even when <CODE CLASS="parameter" >unread_bytes</CODE > is non-zero. To determine if there is more data to be read, use <A HREF="function.feof.html" ><B CLASS="function" >feof()</B ></A > instead of reading this item. </P ></LI ><LI ><P > <CODE CLASS="parameter" >unread_bytes</CODE > (int) - the number of bytes currently contained in the PHP's own internal buffer. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Nota: </B > You shouldn't use this value in a script. </P ></BLOCKQUOTE ></DIV ></LI ></UL ><P > The following items were added in PHP 4.3.0: </P ><P ></P ><UL ><LI ><P > <CODE CLASS="parameter" >stream_type</CODE > (string) - a label describing the underlying implementation of the stream. </P ></LI ><LI ><P > <CODE CLASS="parameter" >wrapper_type</CODE > (string) - a label describing the protocol wrapper implementation layered over the stream. See <A HREF="wrappers.html" >Apêndice N</A > for more information about wrappers. </P ></LI ><LI ><P > <CODE CLASS="parameter" >wrapper_data</CODE > (mixed) - wrapper specific data attached to this stream. See <A HREF="wrappers.html" >Apêndice N</A > for more information about wrappers and their wrapper data. </P ></LI ><LI ><P > <CODE CLASS="parameter" >filters</CODE > (array) - and array containing the names of any filters that have been stacked onto this stream. Documentation on filters can be found in the <A HREF="filters.html" >Filters appendix</A >. </P ></LI ></UL ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Nota: </B > This function was introduced in PHP 4.3.0, but prior to this version, <A HREF="function.socket-get-status.html" ><B CLASS="function" >socket_get_status()</B ></A > could be used to retrieve the first four items, for <SPAN CLASS="emphasis" ><I CLASS="emphasis" >socket based streams only</I ></SPAN >. </P ><P > In PHP 4.3.0 and later, <A HREF="function.socket-get-status.html" ><B CLASS="function" >socket_get_status()</B ></A > is an alias for this function. </P ></BLOCKQUOTE ></DIV ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Nota: </B >This function does NOT work on sockets created by the <A HREF="ref.sockets.html" >Socket extension</A >. </P ></BLOCKQUOTE ></DIV ><P > The following items were added in PHP 5.0.0: </P ><P ></P ><UL ><LI ><P > <CODE CLASS="parameter" >mode</CODE > (string) - the type of access required for this stream (see Table 1 of the <A HREF="function.fopen.html" >fopen()</A > reference) </P ></LI ><LI ><P > <CODE CLASS="parameter" >seekable</CODE > (bool) - whether the current stream can be seeked. </P ></LI ><LI ><P > <CODE CLASS="parameter" >uri</CODE > (string) - the URI/filename associated with this stream. </P ></LI ></UL ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.stream-get-line.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Principal</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.stream-get-transports.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >stream_get_line</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.stream.html" ACCESSKEY="U" >Acima</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >stream_get_transports</TD ></TR ></TABLE ></DIV ></BODY ></HTML >