Dynamic Web Pages: deutschsprachiger PHP Knotenpunkt seit 1999

Dynamic Web Pages : deutschsprachiges PHP-Handbuch : http-negotiate-language _

 
  PHP Architect  
  _  
 
<http_negotiate_ctype ob_deflatehandler>
Letzte Aktualisierung: Sun, 21 Sep 2014
 

http_negotiate_language

(PECL)

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



<http_negotiate_ctype ob_deflatehandler>
Letzte Aktualisierung: Sun, 21 Sep 2014
 


powered by Hetzner
top Alle Rechte vorbehalten. © Dynamic Web Pages 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 top

Werbung an/aus Werbung aus Werbung an