Read part of a file in PHP

前端 未结 3 1185
醉酒成梦
醉酒成梦 2021-01-24 00:51

I would like to read the last 1 megabyte of a MP3 file and calculate SHA1 checksum for just that part of the file. The reason that I would want this is that when I\'m looking fo

3条回答
  •  时光说笑
    2021-01-24 01:09

    Try fseek. This will move the pointer to ~1024 kbytes before the end of the file.

     fseek($fp, -1024 * 1024, SEEK_END);
    

提交回复
热议问题