📄 function.iconv-get-encoding.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Retrieve internal configuration variables of iconv extension</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="ref.iconv.html">iconv Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.iconv-mime-decode-headers.html">iconv_mime_decode_headers</a></div> <div class="up"><a href="ref.iconv.html">iconv Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.iconv-get-encoding" class="refentry"> <div class="refnamediv"> <h1 class="refname">iconv_get_encoding</h1> <p class="verinfo">(PHP 4 >= 4.0.5, PHP 5)</p><p class="refpurpose"><span class="refname">iconv_get_encoding</span> — <span class="dc-title">Retrieve internal configuration variables of iconv extension</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><b><b>iconv_get_encoding</b></b></span> ([ <span class="methodparam"><span class="type">string</span> <tt class="parameter">$type</tt></span> ] )</div> <p class="para rdfs-comment"> Retrieve internal configuration variables of iconv extension. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">type</tt></i></span> <dd> <p class="para"> The value of the optional <i><tt class="parameter">type</tt></i> can be: <ul class="simplelist"> <li class="member">all</li> <li class="member">input_encoding</li> <li class="member">output_encoding</li> <li class="member">internal_encoding</li> </ul> </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the current value of the internal configuration variable if successful, or <b><tt>FALSE</tt></b> on failure. </p> <p class="para"> If <i><tt class="parameter">type</tt></i> is omitted or set to "all", <b>iconv_get_encoding()</b> returns an array that stores all these variables. </p> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example"> <p><b>Example #1 <b>iconv_get_encoding()</b> example</b></p> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><pre><br /><span style="color: #0000BB"><?php<br />iconv_set_encoding</span><span style="color: #007700">(</span><span style="color: #DD0000">"internal_encoding"</span><span style="color: #007700">, </span><span style="color: #DD0000">"UTF-8"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">iconv_set_encoding</span><span style="color: #007700">(</span><span style="color: #DD0000">"output_encoding"</span><span style="color: #007700">, </span><span style="color: #DD0000">"ISO-8859-1"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">iconv_get_encoding</span><span style="color: #007700">(</span><span style="color: #DD0000">'all'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?><br /></span></pre></span></code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents"><pre><div class="cdata"><pre>Array( [input_encoding] => ISO-8859-1 [output_encoding] => ISO-8859-1 [internal_encoding] => UTF-8)</pre></div> </pre></div> </div> </p> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="function.iconv-set-encoding.html" class="function" rel="rdfs-seeAlso">iconv_set_encoding()</a></li> <li class="member"><a href="function.ob-iconv-handler.html" class="function" rel="rdfs-seeAlso">ob_iconv_handler()</a></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.iconv.html">iconv Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.iconv-mime-decode-headers.html">iconv_mime_decode_headers</a></div> <div class="up"><a href="ref.iconv.html">iconv Functions</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 + -