PHP stream_get_meta_data return value _php base

Source: Internet
Author: User

The test code is as follows:

Copy Code code as follows:

<?php
$FP =fopen ("http://www.sina.com.cn", ' R ');
$stream _meta = Stream_get_meta_data ($FP);
Print_r ($stream _meta);
?>

in my native output is as follows:


Array


(


[Wrapper_data] =&gt; Array


         (


[0] =&gt; http/1.0 OK


[1] =&gt; date:tue, Dec 10:08:11 GMT


[2] =&gt; Server:apache


[3] =&gt; last-modified:tue, Dec 10:07:12 GMT


[4] =&gt; accept-ranges:bytes


[5] =&gt; X-powered-by:mod_xlayout/rc2


[6] =&gt; cache-control:max-age=60


[7] =&gt; expires:tue, Dec 10:09:11 GMT


[8] =&gt; vary:accept-encoding


[9] =&gt; x-ua-compatible:ie=emulateie7


[Ten] =&gt; content-type:text/html


[one] =&gt; age:26


[[] =&gt; content-length:675274


[] =&gt; x-cache:hit from xd33-98.hp08040037.sina.com.cn


[] =&gt; connection:close


         )





[Wrapper_type] =&gt; http


[Stream_type] =&gt; Tcp_socket/ssl


[mode] =&gt; R


[unread_bytes] =&gt; 3759


[Seekable] =&gt;


[URI] =&gt; http://www.sina.com.cn


[timed_out] =&gt;


[blocked] =&gt; 1


[EOF] =&gt;


)





Description





array stream_get_meta_data (int $fp)


returns information about the existing stream. can be any stream established through fopen (), Fsockopen () and Pfsockopen (). The returned array contains the following items:





Timed_out (BOOL)-True if waiting for data Shireu timed out in the last Call to Fread () or fgets ().





blocked (bool)-true if the stream is in blocked IO mode. See Stream_set_blocking ().





EOF (BOOL)-true if the stream reaches the end of the file. Note that you can also be TRUE for the socket stream even when unread_bytes is a value other than 0. To determine if more data is readable, use feof () instead of reading the value of this item.





unread_bytes (int)-The number of bytes currently in PHP's own internal buffer.





Note: Do not use this value in scripts.





the following items are PHP 4.3 new:





Stream_type (String)-a callout that describes the underlying implementation of a stream.





Wrapper_type (String)-a callout that encapsulates the implementation of a layered protocol that describes a stream. For more information on encapsulating protocols, see supported protocols and encapsulation protocols.





wrapper_data (mixed)-the package protocol data that is attached to the current stream. For more information on encapsulation protocols and their data, see supported protocols and encapsulation protocols.





Filters (Array)-contains arrays of any filter names that are superimposed on the current stream. The filter's documentation is shown in the appendix to the list of available filters.





Note:





This function is introduced in PHP 4.3, before this release, you can use Socket_get_status () to obtain the first four items and only for the socket based flow.





in PHP 4.3 and later, Socket_get_status () is the alias for this function.








Note: This function does not work on streams created through the Socket extension library.





the following items for PHP 5.0 add:





mode (String)-the type of access required for the current stream (see table 1 in fopen ()).





seekable (BOOL)-can be positioned in the current stream.





URI (String)-the URI or file name associated with the current stream.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.