mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
89 lines
3.5 KiB
HTML
89 lines
3.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>GeoIP 数据库是否可用</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.geoip-db-avail" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">geoip_db_avail</h1>
|
|
<p class="verinfo">(PECL geoip >= 1.0.1)</p><p class="refpurpose"><span class="refname">geoip_db_avail</span> — <span class="dc-title">GeoIP 数据库是否可用</span></p>
|
|
|
|
</div>
|
|
<div class="refsect1 description" id="refsect1-function.geoip-db-avail-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>geoip_db_avail</strong></span>
|
|
( <span class="methodparam"><span class="type">int</span> <code class="parameter">$database</code></span>
|
|
) : <span class="type">bool</span></div>
|
|
|
|
|
|
<p class="para rdfs-comment">
|
|
<span class="function"><strong>geoip_db_avail()</strong></span> 函数返回 GeoI P数据库是否可以在磁盘上打开并且可用。
|
|
</p>
|
|
|
|
<p class="para">
|
|
该函数不能用来判断是否是个合适的数据库,除非这个数据库可读。
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.geoip-db-avail-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">database</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
变量类型为整型。你可以使用该扩展的<a href="geoip.constants.html" class="link">预定义常量</a>(比如: GEOIP_*_EDITION)。
|
|
</p>
|
|
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.geoip-db-avail-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
如果存在则返回 <strong><code>TRUE</code></strong> , 未找到则返回 <strong><code>FALSE</code></strong> , 错误则返回 <strong><code>NULL</code></strong> 。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.geoip-db-avail-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-4488">
|
|
<p><strong>Example #1 <span class="function"><strong>geoip_db_avail()</strong></span> 函数的使用范例:</strong></p>
|
|
<div class="example-contents"><p>
|
|
以下代码将会输出当前数据库的版本信息。
|
|
</p></div>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /><br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">geoip_db_avail</span><span style="color: #007700">(</span><span style="color: #0000BB">GEOIP_COUNTRY_EDITION</span><span style="color: #007700">))<br /> print </span><span style="color: #0000BB">geoip_database_info</span><span style="color: #007700">(</span><span style="color: #0000BB">GEOIP_COUNTRY_EDITION</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
<div class="example-contents"><p>以上例程会输出:</p></div>
|
|
<div class="example-contents screen">
|
|
<div class="cdata"><pre>
|
|
GEO-106FREE 20080801 Build 1 Copyright (c) 2006 MaxMind LLC All Rights Reserved
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |