Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 05cd670d8a02b2b4a0ffb1756f2e8308 > files > 5755

php-manual-zh-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>curl_getinfo</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="CURL, Client URL Library Functions"
HREF="ref.curl.html"><LINK
REL="PREVIOUS"
TITLE="curl_exec"
HREF="function.curl-exec.html"><LINK
REL="NEXT"
TITLE="curl_init"
HREF="function.curl-init.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="function.curl-exec.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.curl-init.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.curl-getinfo"
></A
>curl_getinfo</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN26020"
></A
><P
>    (PHP 4 &#62;= 4.0.4, PHP 5)</P
>curl_getinfo&nbsp;--&nbsp;Get information regarding a specific transfer</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN26023"
></A
><H2
>说明</H2
>mixed <B
CLASS="methodname"
>curl_getinfo</B
> ( resource ch [, int opt] )<BR
></BR
><P
>&#13;   Gets information about the last transfer, 
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN26035"
></A
><H2
>参数</H2
><P
>&#13;   <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><CODE
CLASS="parameter"
>ch</CODE
></DT
><DD
><P
>A cURL handle returned by 
<A
HREF="function.curl-init.html"
><B
CLASS="function"
>curl_init()</B
></A
>.</P
></DD
><DT
><CODE
CLASS="parameter"
>opt</CODE
></DT
><DD
><P
>&#13;       This may be one of the following constants:
       <P
></P
><UL
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_EFFECTIVE_URL</B
></TT
> - Last effective URL
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_HTTP_CODE</B
></TT
> - Last received HTTP code
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_FILETIME</B
></TT
> - Remote time of the retrieved document, if -1 is returned the time of the document is unknown
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_TOTAL_TIME</B
></TT
> - Total transaction time in seconds for last transfer
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_NAMELOOKUP_TIME</B
></TT
> - Time in seconds until name resolving was complete
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_CONNECT_TIME</B
></TT
> - Time in seconds it took to establish the connection
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_PRETRANSFER_TIME</B
></TT
> - Time in seconds from start until just before file transfer begins
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_STARTTRANSFER_TIME</B
></TT
> - Time in seconds until the first byte is about to be transferred
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_REDIRECT_TIME</B
></TT
> - Time in seconds of all redirection steps before final transaction was started
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_SIZE_UPLOAD</B
></TT
> - Total number of bytes uploaded
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_SIZE_DOWNLOAD</B
></TT
> - Total number of bytes downloaded
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_SPEED_DOWNLOAD</B
></TT
> - Average download speed
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_SPEED_UPLOAD</B
></TT
> - Average upload speed
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_HEADER_SIZE</B
></TT
> - Total size of all headers received
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_HEADER_OUT</B
></TT
> - The request string sent. Available since PHP 6.0.0
         </P
></LI
><LI
><P
>&#13;        <TT
CLASS="constant"
><B
>CURLINFO_REQUEST_SIZE</B
></TT
> - Total size of issued requests, currently only for HTTP requests
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_SSL_VERIFYRESULT</B
></TT
> - Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_CONTENT_LENGTH_DOWNLOAD</B
></TT
> - content-length of download, read from Content-Length: field
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_CONTENT_LENGTH_UPLOAD</B
></TT
> - Specified size of upload
         </P
></LI
><LI
><P
>&#13;          <TT
CLASS="constant"
><B
>CURLINFO_CONTENT_TYPE</B
></TT
> - Content-type of downloaded object, NULL indicates server did not send valid Content-Type: header
         </P
></LI
></UL
>
      </P
></DD
></DL
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN26111"
></A
><H2
>返回值</H2
><P
>&#13;   If <CODE
CLASS="parameter"
>opt</CODE
> is given, returns its value as a string.
   Otherwise, returns an associative array with the following elements 
   (which correspond to <CODE
CLASS="parameter"
>opt</CODE
>):
   <P
></P
><UL
><LI
><P
>&#13;      "url"
     </P
></LI
><LI
><P
>&#13;      "content_type"
     </P
></LI
><LI
><P
>&#13;      "http_code"
     </P
></LI
><LI
><P
>&#13;      "header_size"
     </P
></LI
><LI
><P
>&#13;      "request_size"
     </P
></LI
><LI
><P
>&#13;      "filetime"
     </P
></LI
><LI
><P
>&#13;      "ssl_verify_result"
     </P
></LI
><LI
><P
>&#13;      "redirect_count"
     </P
></LI
><LI
><P
>&#13;      "total_time"
     </P
></LI
><LI
><P
>&#13;      "namelookup_time"
     </P
></LI
><LI
><P
>&#13;      "connect_time"
     </P
></LI
><LI
><P
>&#13;      "pretransfer_time"
     </P
></LI
><LI
><P
>&#13;      "size_upload"
     </P
></LI
><LI
><P
>&#13;      "size_download"
     </P
></LI
><LI
><P
>&#13;      "speed_download"
     </P
></LI
><LI
><P
>&#13;      "speed_upload"
     </P
></LI
><LI
><P
>&#13;      "download_content_length"
     </P
></LI
><LI
><P
>&#13;      "upload_content_length"
     </P
></LI
><LI
><P
>&#13;      "starttransfer_time"
     </P
></LI
><LI
><P
>&#13;      "redirect_time"
     </P
></LI
></UL
>
  </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="function.curl-exec.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="function.curl-init.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>curl_exec</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.curl.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>curl_init</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>