PHP-Logo
Druckansicht von http://www.php-homepage.de/manual/function.http-negotiate-language.php

PHP-Logo
[ Main Menue ]
Homepage
Downloads
Artikel
Scripts
Forum
PHP-Manual
Links
News
Freelancer
Bücher
RuDolF
Suche
Misc
Über diese Seite
Kontakt
Wunschzettel
MyGuestbook
*
[ Suche ]
*
[ Manual ]
HTTP Funktionen
*

Follow on Twitter - @phphomepage

RSS Feed blogoscoop
 http_negotiate_content_type  Letztes Update:
07.01.2012
ob_deflatehandler 

http_negotiate_language

(PECL pecl_http >= 0.1.0)

http_negotiate_languageNegotiate clients preferred language

Beschreibung

string http_negotiate_language ( array $supported [, array &$result ] )

This function negotiates the clients preferred language based on its Accept-Language 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).

Parameter-Liste

supported

array containing the supported languages as values

result

will be filled with an array containing the negotiation results

Rückgabewerte

Returns the negotiated language or the default language (i.e. first array entry) if none match.

Beispiele

Beispiel #1 Using http_negotiate_language()

<?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);
?>

© Copyright 1999 - 2011 by Mark Kronsbein | Impressum | NutzungsbedingungenWeiterempfehlen | Seitenanfang
0.0263