📄 function.geoip-country-name-by-name.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Get the full country name</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.geoip-country-code3-by-name.html">geoip_country_code3_by_name</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.geoip-database-info.html">geoip_database_info</a></div> <div class="up"><a href="ref.geoip.html">GeoIP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.geoip-country-name-by-name" class="refentry"> <div class="refnamediv"> <h1 class="refname">geoip_country_name_by_name</h1> <p class="verinfo">(PECL geoip:0.2.0-1.0.1)</p><p class="refpurpose"><span class="refname">geoip_country_name_by_name</span> — <span class="dc-title">Get the full country name</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">string</span> <span class="methodname"><b><b>geoip_country_name_by_name</b></b></span> ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$hostname</tt></span> )</div> <p class="para rdfs-comment"> The <b>geoip_country_name_by_name()</b> function will return the full country name corresponding to a hostname or an IP address. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">hostname</tt></i></span> <dd> <p class="para"> The hostname or IP address whose location is to be looked-up. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the country name on success, or <b><tt>FALSE</tt></b> if the address cannot be found in the database. </p> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example"> <p><b>Example #1 A <b>geoip_country_name_by_name()</b> example</b></p> <div class="example-contents"><p> This will print where the host example.com is located. </p></div> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br />$country </span><span style="color: #007700">= </span><span style="color: #0000BB">geoip_country_name_by_name</span><span style="color: #007700">(</span><span style="color: #DD0000">'www.example.com'</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">$country</span><span style="color: #007700">) {<br /> echo </span><span style="color: #DD0000">'This host is located in: ' </span><span style="color: #007700">. </span><span style="color: #0000BB">$country</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></span></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> This host is located in: United States</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.geoip-country-code-by-name.html" class="function" rel="rdfs-seeAlso">geoip_country_code_by_name()</a></li> <li class="member"><a href="function.geoip-country-code3-by-name.html" class="function" rel="rdfs-seeAlso">geoip_country_code3_by_name()</a></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.geoip-country-code3-by-name.html">geoip_country_code3_by_name</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.geoip-database-info.html">geoip_database_info</a></div> <div class="up"><a href="ref.geoip.html">GeoIP 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 + -