<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >php_stream_is</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="Streams Common API Reference" HREF="streams.common-api.html"><LINK REL="PREVIOUS" TITLE="php_stream_is_persistent" HREF="streams.php-stream-is-persistent.html"><LINK REL="NEXT" TITLE="php_stream_passthru" HREF="streams.php-stream-passthru.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" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="streams.php-stream-is-persistent.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="streams.php-stream-passthru.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="streams.php-stream-is" ></A >php_stream_is</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN253069" ></A >php_stream_is -- Determines if a stream is of a particular type</DIV ><DIV CLASS="refsect1" ><A NAME="AEN253072" ></A ><H2 >Description</H2 >int <B CLASS="methodname" >php_stream_is</B > ( php_stream * stream, int istype )<BR ></BR ><P > <B CLASS="function" >php_stream_is()</B > returns 1 if <CODE CLASS="parameter" >stream</CODE > is of the type specified by <CODE CLASS="parameter" >istype</CODE >, or 0 otherwise. <DIV CLASS="table" ><A NAME="AEN253087" ></A ><P ><B >表 44-1. Values for <CODE CLASS="parameter" >istype</CODE ></B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><THEAD ><TR ><TH >Value</TH ><TH >Meaning</TH ></TR ></THEAD ><TBODY ><TR ><TD >PHP_STREAM_IS_STDIO</TD ><TD >The stream is implemented using the stdio implementation</TD ></TR ><TR ><TD >PHP_STREAM_IS_SOCKET</TD ><TD >The stream is implemented using the network socket implementation</TD ></TR ><TR ><TD >PHP_STREAM_IS_USERSPACE</TD ><TD >The stream is implemented using the userspace object implementation</TD ></TR ><TR ><TD >PHP_STREAM_IS_MEMORY</TD ><TD >The stream is implemented using the grow-on-demand memory stream implementation</TD ></TR ></TBODY ></TABLE ></DIV > </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > The PHP_STREAM_IS_XXX "constants" are actually defined as pointers to the underlying stream operations structure. If your extension (or some other extension) defines additional streams, it should also declare a PHP_STREAM_IS_XXX constant in it's header file that you can use as the basis of this comparison. </P ></BLOCKQUOTE ></DIV ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > This function is implemented as a simple (and fast) pointer comparison, and does not change the stream state in any way. </P ></BLOCKQUOTE ></DIV ><P > See also <B CLASS="function" >php_stream_cast()</B > and <B CLASS="function" >php_stream_can_cast()</B >. </P ></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="streams.php-stream-is-persistent.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="streams.php-stream-passthru.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >php_stream_is_persistent</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="streams.common-api.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >php_stream_passthru</TD ></TR ></TABLE ></DIV ></BODY ></HTML >