HTTP 関数
PHP Manual

http_negotiate_content_type

(PECL pecl_http:0.19.0-1.5.5)

http_negotiate_content_typeクライアントが希望している content type を選択する

説明

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

この関数は、クライアントが希望している content type を Accept HTTP ヘッダに基づいて選択します。 qualifier も理解し、qualifier の指定されていない content type が最優先されます。

パラメータ

supported

サポートする content type を値にもつ配列。

result

選択した結果がこの配列に含まれます。

返り値

選択された content type、あるいは一致するものがなかった場合はデフォルトの content type (配列の最初のエントリ) を返します。

例1 http_negotiate_content_type() の使用例

<?php
$content_types 
= array('application/xhtml+xml''text/html');
http_send_content_type(http_negotiate_content_type($content_types));
?>


HTTP 関数
PHP Manual
[お役立ちリンク集]

NPO法人の設立(東京・大阪) 東京や大阪などNPO法人を設立する場合の注意点等を紹介

不動産・賃貸・マンション 不動産・賃貸・マンションに関する用語集です。

堺市の入院・内科

大阪の賃貸探し 大阪で賃貸を探している方は大阪ホームへ

東京の賃貸マンション 東京で賃貸を探すなら東京賃貸.orgへ