reference/fileinfo/functions/mime-content-type.xml
968bb98efdcc2a333899be3d1bdefec317d09170
...
...
@@ -0,0 +1,104 @@
1
+
<?xml version="1.0" encoding="utf-8"?>
2
+
<!-- $Revision$ -->
3
+
<refentry xml:id="function.mime-content-type" xmlns="http://docbook.org/ns/docbook">
4
+
<refnamediv>
5
+
<refname>mime_content_type</refname>
6
+
<refpurpose>Detect MIME Content-type for a file</refpurpose>
7
+
</refnamediv>
8
+
9
+
<refsect1 role="description">
10
+
&reftitle.description;
11
+
<methodsynopsis>
12
+
<type class="union"><type>string</type><type>false</type></type><methodname>mime_content_type</methodname>
13
+
<methodparam><type class="union"><type>resource</type><type>string</type></type><parameter>filename</parameter></methodparam>
14
+
</methodsynopsis>
15
+
<para>
16
+
Returns the MIME content type for a file as determined by using
17
+
information from the <filename>magic.mime</filename> file.
18
+
</para>
19
+
</refsect1>
20
+

21
+
<refsect1 role="parameters">
22
+
&reftitle.parameters;
23
+
<para>
24
+
<variablelist>
25
+
<varlistentry>
26
+
<term><parameter>filename</parameter></term>
27
+
<listitem>
28
+
<para>
29
+
Path to the tested file.
30
+
</para>
31
+
</listitem>
32
+
</varlistentry>
33
+
</variablelist>
34
+
</para>
35
+
</refsect1>
36
+

37
+
<refsect1 role="returnvalues">
38
+
&reftitle.returnvalues;
39
+
<para>
40
+
Returns the content type in MIME format, like
41
+
<literal>text/plain</literal> or <literal>application/octet-stream</literal>,
42
+
&return.falseforfailure;.
43
+
</para>
44
+
</refsect1>
45
+

46
+
<refsect1 role="errors">
47
+
&reftitle.errors;
48
+
&fs.emits.warning.on.failure;
49
+
</refsect1>
50
+

51
+
<refsect1 role="examples">
52
+
&reftitle.examples;
53
+
<para>
54
+
<example>
55
+
<title><function>mime_content_type</function> Example</title>
56
+
<programlisting role="php">
57
+
<![CDATA[
58
+
<?php
59
+
echo mime_content_type('php.gif') . "\n";
60
+
echo mime_content_type('test.php');
61
+
?>
62
+
]]>
63
+
</programlisting>
64
+
&example.outputs;
65
+
<screen>
66
+
<![CDATA[
67
+
image/gif
68
+
text/plain
69
+
]]>
70
+
</screen>
71
+
</example>
72
+
</para>
73
+
</refsect1>
74
+
75
+
<refsect1 role="seealso">
76
+
&reftitle.seealso;
77
+
<para>
78
+
<simplelist>
79
+
<member><function>finfo_file</function></member>
80
+
<member><function>finfo_buffer</function></member>
81
+
</simplelist>
82
+
</para>
83
+
</refsect1>
84
+
</refentry>
85
+
<!-- Keep this comment at the end of the file
86
+
Local variables:
87
+
mode: sgml
88
+
sgml-omittag:t
89
+
sgml-shorttag:t
90
+
sgml-minimize-attributes:nil
91
+
sgml-always-quote-attributes:t
92
+
sgml-indent-step:1
93
+
sgml-indent-data:t
94
+
indent-tabs-mode:nil
95
+
sgml-parent-document:nil
96
+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
97
+
sgml-exposed-tags:nil
98
+
sgml-local-catalogs:nil
99
+
sgml-local-ecat-files:nil
100
+
End:
101
+
vim600: syn=xml fen fdm=syntax fdl=2 si
102
+
vim: et tw=78 syn=sgml
103
+
vi: ts=1 sw=1
104
+
-->
0
105