PHP获取远程http或ftp文件的md5值

PHP获取本地文件的md5值:

md5_file("/path/to/file.png");

PHP获取远程http文件的md5值:

md5_file("https://www.baidu.com/s?wd=%E4%BB%8A%E6%97%A5%E6%96%B0%E9%B2%9C%E4%BA%8B&tn=SE_Pclogo_6ysd4c7a&sa=ire_dl_gh_logo&rsv_dl=igh_logo_pc")

PHP获取远程ftp文件的md5值:

md5_file("ftp://username:password@192.168.6.1/aa4c319f1b8197e381beeb8c45e6c68d.apk")

如果远程文件很大的话,执行会非常费时,因为要先下载下来。

posted @ 2019-04-15 12:33  itbsl  阅读(2218)  评论(0编辑  收藏  举报