相关疑难解决方法(0)

如何在PHP中获取文件的内容类型?

我正在使用PHP发送带附件的电子邮件.附件可以是几种不同文件类型中的任何一种(pdf,txt,doc,swf等).

首先,脚本使用"file_get_contents"获取文件.

之后,脚本在标题中回响:

Content-Type: <?php echo $the_content_type; ?>; name="<?php echo $the_file_name; ?>"
Run Code Online (Sandbox Code Playgroud)

如何为$ the_content_type设置正确的值?

php email content-type file-get-contents

17
推荐指数
3
解决办法
7万
查看次数

标签 统计

content-type ×1

email ×1

file-get-contents ×1

php ×1