PHP-md5_file() 函数

2010年05月14日  |  19:09分类:PHP技术  |  标签:  |  466 views

定义和用法

md5_file() 函数计算文件的 MD5 散列。 

md5() 函数使用 RSA 数据安全,包括 MD5 报文摘译算法。 

如果成功,则返回所计算的 MD5 散列,如果失败,则返回 false。 

(PHP 4 >= 4.2.0, PHP 5)  

md5_file – Calculates the md5 hash of a given file 

说明

string md5_file ( string filename [, bool raw_output] )

Calculates the MD5 hash of the file specified by the filename parameter using the RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash. The hash is a 32-character hexadecimal number.  
参数

  filename

The filename raw_output
When TRUE, returns the digest in raw binary format with a length of 16. Defaults to FALSE
返回值 

Returns a string on success, FALSE otherwise

例如

<?php
$filename = “test.txt”;
$md5file = md5_file($filename);
echo $md5file;
?>

输出:

5d41402abc4b2a76b9719d911017c592

原创文章,转载请注明: 转载自长沙营销型网站建设,营销型网站开发,Zen-Cart | 小龙包

本文链接地址: PHP-md5_file() 函数

喜欢本文,那就收藏到: Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网

发表您的评论

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word