doubao7287 2014-04-16 18:22
浏览 9

如何比较PHP中文件的最后一个字节

How would you do, in PHP, to open a binary file (PDF) and see if in the last byte is a x0D?

I have some PDFs which I need to be sure that have a ending x0A instead of x0D before sending it to a program.

  • 写回答

2条回答 默认 最新

  • duanluo5096 2014-04-16 18:30
    关注

    open your file with $pdf = file_get_contents('your_file.pdf');, then check your string with regex preg_match("/x0D$/", $pdf);

    评论

报告相同问题?

悬赏问题

  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计