<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >md5_file</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="String 字符串处理函数" HREF="ref.strings.html"><LINK REL="PREVIOUS" TITLE="ltrim" HREF="function.ltrim.html"><LINK REL="NEXT" TITLE="md5" HREF="function.md5.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.ltrim.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.md5.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.md5-file" ></A >md5_file</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN225818" ></A ><P > (PHP 4 >= 4.2.0, PHP 5)</P >md5_file -- Calculates the md5 hash of a given file</DIV ><DIV CLASS="refsect1" ><A NAME="AEN225821" ></A ><H2 >说明</H2 >string <B CLASS="methodname" >md5_file</B > ( string filename [, bool raw_output] )<BR ></BR ><P > Calculates the MD5 hash of the file specified by the <CODE CLASS="parameter" >filename</CODE > parameter using the <A HREF="http://www.faqs.org/rfcs/rfc1321" TARGET="_top" >RSA Data Security, Inc. MD5 Message-Digest Algorithm</A >, and returns that hash. The hash is a 32-character hexadecimal number. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN225835" ></A ><H2 >参数</H2 ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><CODE CLASS="parameter" >filename</CODE ></DT ><DD ><P > The filename </P ></DD ><DT ><CODE CLASS="parameter" >raw_output</CODE ></DT ><DD ><P > When <TT CLASS="constant" ><B >TRUE</B ></TT >, returns the digest in raw binary format with a length of 16. Defaults to <TT CLASS="constant" ><B >FALSE</B ></TT >. </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN225851" ></A ><H2 >返回值</H2 ><P > Returns a string on success, <TT CLASS="constant" ><B >FALSE</B ></TT > otherwise. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN225855" ></A ><H2 >更新日志</H2 ><P > <DIV CLASS="informaltable" ><P ></P ><A NAME="AEN225858" ></A ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><THEAD ><TR ><TH >版本</TH ><TH >说明</TH ></TR ></THEAD ><TBODY ><TR ><TD >5.0.0</TD ><TD > Added the <CODE CLASS="parameter" >raw_output</CODE > parameter </TD ></TR ><TR ><TD >5.1.0</TD ><TD > Changed the function to use the streams API. It means that you can use it with wrappers, like <TT CLASS="literal" >md5_file('http://example.com/..')</TT > </TD ></TR ></TBODY ></TABLE ><P ></P ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN225873" ></A ><H2 >参见</H2 ><P > <P ></P ><TABLE BORDER="0" ><TBODY ><TR ><TD ><A HREF="function.md5.html" ><B CLASS="function" >md5()</B ></A ></TD ></TR ><TR ><TD ><A HREF="function.sha1-file.html" ><B CLASS="function" >sha1_file()</B ></A ></TD ></TR ><TR ><TD ><A HREF="function.crc32.html" ><B CLASS="function" >crc32()</B ></A ></TD ></TR ></TBODY ></TABLE ><P ></P > </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.ltrim.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.md5.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >ltrim</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.strings.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >md5</TD ></TR ></TABLE ></DIV ></BODY ></HTML >