How to select content type from HTTP Accept header in PHP

后端 未结 7 1037
[愿得一人]
[愿得一人] 2020-12-16 13:10

I\'m trying to build a standard compliant website framework which serves XHTML 1.1 as application/xhtml+xml or HTML 4.01 as text/html depending on the browser support. Curre

7条回答
  •  轮回少年
    2020-12-16 13:28

    PEAR's HTTP2 library supports parsing all types of Accept headers. It's installable via composer and PEAR.

    Examples can be found at the documentation or my blog post.

提交回复
热议问题