Files
php-doc-ru/reference/geoip/functions/geoip-region-by-name.xml
Sergey Panteleev daef8df962 Обнуление тега Reviewed (#364)
[skip-lint]
[skip-spellcheck]
2021-11-16 13:03:53 +03:00

119 lines
3.5 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 4754397753fd79f1c846868b66a2448babab1c54 Maintainer: aur Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.geoip-region-by-name" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>geoip_region_by_name</refname>
<refpurpose>Возвращает коды страны и региона</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>geoip_region_by_name</methodname>
<methodparam><type>string</type><parameter>hostname</parameter></methodparam>
</methodsynopsis>
<para>
Функция<function>geoip_region_by_name</function> возвращает коды страны и региона,
соответствующих имени хоста или IP-адресу.
</para>
<para>
Эта функция доступна только для тех, кто приобрёл коммерческую версию
GeoIP Region. Если такая база отсутствует, выводится предупреждение.
</para>
<para>
Следующие имена ключей возвращаемого ассоциативного массива:
</para>
<para>
<itemizedlist>
<listitem>
<simpara>
"country_code" -- Двухбуквенный код страны (смотрите
<function>geoip_country_code_by_name</function>)
</simpara>
</listitem>
<listitem>
<simpara>
"region" -- Код региона (например, CA для Калифорнии)
</simpara>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>hostname</parameter></term>
<listitem>
<para>
Имя хоста или IP-адрес, данные о стране и регионе, которого необходимо найти.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает ассоциативный массив в случае успешного выполнения или &false;,
если адрес не будет найден в базе данных.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример использования <function>geoip_region_by_name</function></title>
<para>
Выведет массив, состоящий из кода страны и кода региона для хоста example.com.
</para>
<programlisting role="php">
<![CDATA[
<?php
$region = geoip_region_by_name('www.example.com');
if ($region) {
print_r($region);
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Array
(
[country_code] => US
[region] => CA
)
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->