mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-25 13:28:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@219536 c90b9560-bf6c-de11-be94-00142212c4b1
151 lines
3.5 KiB
XML
151 lines
3.5 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<!-- Generated by xml_proto.php v2.4. Found in /scripts directory of phpdoc. -->
|
|
<refentry id="function.http-negotiate-language">
|
|
<refnamediv>
|
|
<refname>http_negotiate_language</refname>
|
|
<refpurpose>Negotiate clients preferred language</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>http_negotiate_language</methodname>
|
|
<methodparam choice="opt"><type>array</type><parameter>supported</parameter></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter role="reference">result</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function negotiates the clients preferred language based on its
|
|
<literal>Accept-Language</literal> HTTP header. The qualifier is recognized and languages
|
|
without qualifier are rated highest. The qualifier will be decreased by
|
|
10% for partial matches (i.e. matching primary language).
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>supported</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Array containing the supported languages as values
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>result</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Will be filled with an array containing the negotiation results
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns the negotiated language or the default language (i.e. first array entry) if none match.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<!-- Use when ERRORS exist
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
When does this function throw E_* level errors, or exceptions?
|
|
</para>
|
|
</refsect1>
|
|
-->
|
|
|
|
|
|
<!-- Use when a CHANGELOG exists
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>Enter the PHP version of change here</entry>
|
|
<entry>Description of change</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
-->
|
|
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Using <function>http_negotiate_language</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$langs = array(
|
|
'en-US',// default
|
|
'fr',
|
|
'fr-FR',
|
|
'de',
|
|
'de-DE',
|
|
'de-AT',
|
|
'de-CH',
|
|
);
|
|
|
|
include './langs/'. http_negotiate_language($langs, $result) .'.php';
|
|
|
|
print_r($result);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<!-- Use when adding See Also links
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function></function></member>
|
|
<member>Or <link linkend="somethingelse">something else</link></member>
|
|
</simplelist>
|
|
</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:"../../../../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
|
|
-->
|