Web студия "GrandView"
  Главная   Написать Контакты
   
   
О проекте
Руководство php
 

http_negotiate_charset

(PECL)

http_negotiate_charset -- Negotiate clients preferred character set

Описание

string http_negotiate_charset ( [array supported [, array &result]] )

This function negotiates the clients preferred charset based on its Accept-Charset HTTP header. The qualifier is recognized and charsets without qualifier are rated highest.

Список параметров

supported

Array containing the supported charsets as values

result

Will be filled with an array containing the negotiation results

Возвращаемые значения

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

Примеры

Пример 1. Using http_negotiate_charset()

<?php
$charsets
= array(
       
'iso-8859-1', // default
       
'iso-8859-2',
       
'iso-8859-15',
       
'utf-8'
);

$pref = http_negotiate_charset($charsets, $result);

if (
strcmp($pref, 'iso-8859-1')) {
       
iconv_set_encoding('internal_encoding', 'iso-8859-1');
       
iconv_set_encoding('output_encoding', $pref);
       
ob_start('ob_iconv_handler');
}

print_r($result);
?>



add a note add a note User Contributed Notes
http_negotiate_charset
There are no user contributed notes for this page.

http_negotiate_ctype> <http_build_cookie
Last updated: Sat, 27 Jan 2007
 
 
Новости
11 июля 2007
Сайт запущен
© 2007 info@grandviewstudio.com

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 324

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 330
Z058440144362 Z348613067571