Query: http_negotiate_charset
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
HTTP_NEGOTIATE_CHARSET(3) 1 HTTP_NEGOTIATE_CHARSET(3) http_negotiate_charset - Negotiate client's preferred character setSYNOPSISstring http_negotiate_charset (array $supported, [array &$result])DESCRIPTIONThis function negotiates the clients preferred charset based on its Accept-Charset HTTP header. The qualifier is recognized and charsets without qualifier are rated highest.PARAMETERSo $supported - array containing the supported charsets as values o $result - will be filled with an array containing the negotiation resultsRETURN VALUESReturns the negotiated charset or the default charset (i.e. first array entry) if none match.EXAMPLESExample #1 Using http_negotiate_charset(3) <?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); ?> PHP Documentation Group HTTP_NEGOTIATE_CHARSET(3)
| Related Man Pages |
|---|
| encode::byte5.18(3pm) - mojave |
| encode::byte(3pm) - mojave |
| iconv_get_encoding(3) - php |
| mb_list_encodings(3) - php |
| encode::byte(3perl) - debian |
| Similar Topics in the Unix Linux Community |
|---|
| User Guide: Posting in the Emergency Forum |
| Forum Video Tutorial: How to Use Code Tags |
| Coming Soon: Upgrade Forum Software (Dec 31 - Jan 1) |
| Denial Of Service Attack Update |