本文介绍了一种用PHP在线读取PDF文件的方法,供大家参考,具体的实现方法如下:


< PHP
如果(!function_exists('read_pdf ')){
功能read_pdf(文件){
如果(strtolower(substr(strrchr($文件),1))!= 'pdf){
回声文件格式错误。
返回;
}
如果(!file_exists(文件)){
回声文件不存在;
返回;
}
头('content-type:应用/ PDF格式);
头('filename =。文件);
ReadFile(文件);
}
}
read_pdf('python_study .pdf);




希望本文能对大家的PHP程序设计有所帮助。