📄 function.httpresponse-guesscontenttype.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Guess content type</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.httpresponse-getthrottledelay.html">HttpResponse::getThrottleDelay</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.httpresponse-redirect.html">HttpResponse::redirect</a></div> <div class="up"><a href="class.httpresponse.html">The HttpResponse</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.httpresponse-guesscontenttype" class="refentry"> <div class="refnamediv"> <h1 class="refname">HttpResponse::guessContentType</h1> <p class="verinfo">(PECL pecl_http:0.13.0-1.5.5)</p><p class="refpurpose"><span class="refname">HttpResponse::guessContentType</span> — <span class="dc-title">Guess content type</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">static</span> <span class="type">string</span> <span class="methodname"><b><b>HttpResponse::guessContentType</b></b></span> ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$magic_file</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$magic_mode=MAGIC_MIME</tt></span> ] )</div> <p class="para rdfs-comment"> Attempts to guess the content type of supplied payload through libmagic. </p> <p class="para"> If the attempt is successful, the guessed <i>Content-Type</i> will automatically be set as response <i>Content-Type</i>. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">magic_file</tt></i></span> <dd> <p class="para"> specifies the magic.mime database to use </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">magic_mode</tt></i></span> <dd> <p class="para"> flags for libmagic </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the guessed content type on success, or <b><tt>FALSE</tt></b> on failure. </p> </div> <div class="refsect1 errors"> <h3 class="title">Errors/Exceptions</h3> <p class="para"> Throws HttpRuntimeException, HttpInvalidParamException. </p> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="methodname"><b><a href="function.httpresponse-getcontenttype.html" class="function" rel="rdfs-seeAlso">HttpResponse::getContentType</a></b></span></li> <li class="member"> <span class="methodname"><b><a href="function.httpresponse-setcontenttype.html" class="function" rel="rdfs-seeAlso">HttpResponse::setContentType</a></b></span></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.httpresponse-getthrottledelay.html">HttpResponse::getThrottleDelay</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.httpresponse-redirect.html">HttpResponse::redirect</a></div> <div class="up"><a href="class.httpresponse.html">The HttpResponse</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -