久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <i id='g3lnT'><tr id='g3lnT'><dt id='g3lnT'><q id='g3lnT'><span id='g3lnT'><b id='g3lnT'><form id='g3lnT'><ins id='g3lnT'></ins><ul id='g3lnT'></ul><sub id='g3lnT'></sub></form><legend id='g3lnT'></legend><bdo id='g3lnT'><pre id='g3lnT'><center id='g3lnT'></center></pre></bdo></b><th id='g3lnT'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='g3lnT'><tfoot id='g3lnT'></tfoot><dl id='g3lnT'><fieldset id='g3lnT'></fieldset></dl></div>
    <tfoot id='g3lnT'></tfoot><legend id='g3lnT'><style id='g3lnT'><dir id='g3lnT'><q id='g3lnT'></q></dir></style></legend>

      • <bdo id='g3lnT'></bdo><ul id='g3lnT'></ul>

      <small id='g3lnT'></small><noframes id='g3lnT'>

      通過(guò) PHP 檢查瀏覽器的語(yǔ)言?

      Checking browser#39;s language by PHP?(通過(guò) PHP 檢查瀏覽器的語(yǔ)言?)
        <tbody id='EFnFF'></tbody>

        <small id='EFnFF'></small><noframes id='EFnFF'>

        <i id='EFnFF'><tr id='EFnFF'><dt id='EFnFF'><q id='EFnFF'><span id='EFnFF'><b id='EFnFF'><form id='EFnFF'><ins id='EFnFF'></ins><ul id='EFnFF'></ul><sub id='EFnFF'></sub></form><legend id='EFnFF'></legend><bdo id='EFnFF'><pre id='EFnFF'><center id='EFnFF'></center></pre></bdo></b><th id='EFnFF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='EFnFF'><tfoot id='EFnFF'></tfoot><dl id='EFnFF'><fieldset id='EFnFF'></fieldset></dl></div>

          <legend id='EFnFF'><style id='EFnFF'><dir id='EFnFF'><q id='EFnFF'></q></dir></style></legend>

            • <bdo id='EFnFF'></bdo><ul id='EFnFF'></ul>
              <tfoot id='EFnFF'></tfoot>
              1. 本文介紹了通過(guò) PHP 檢查瀏覽器的語(yǔ)言?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問題描述

                如何通過(guò) PHP 檢查用戶瀏覽器的語(yǔ)言?

                How can I check the language of user's browser by PHP?

                我需要為美國(guó)和英國(guó)的用戶顯示不同的頁(yè)面.

                I need to show a different page for people in US and in UK.

                我嘗試了以下代碼失敗

                <?php
                if(ereg("us", $_SERVER["HTTP_ACCEPT_LANGUAGE"]))
                   include('http://page.com/us.txt');
                else
                   include('http://page.com/uk.txt');
                ?>
                

                我為美國(guó)和英國(guó)的人們運(yùn)行了一個(gè)特定的代碼.

                I run a specific code for people in US and for them in UK.

                推薦答案

                可能只是區(qū)分大小寫的問題;eregi('en-us') 或 preg_match('/en-us/i') 應(yīng)該已經(jīng)找到了.

                Likely just a case sensitivity issue; eregi('en-us') or preg_match('/en-us/i') should have picked it up.

                但是,有時(shí)僅在標(biāo)題中查找en-us"可能會(huì)出錯(cuò),尤其是當(dāng)同時(shí)列出美國(guó)和英國(guó)語(yǔ)言時(shí).Accept-Language"實(shí)際上是一個(gè)相當(dāng)復(fù)雜的標(biāo)題,您確實(shí)需要一個(gè)合適的解析器.

                However, just looking for ‘en-us’ in the header may get it wrong sometimes, in particular when both the US and UK languages are listed. "Accept-Language" is actually quite a complicated header, which really you'd want a proper parser for.

                如果你有 PECL,整個(gè)工作已經(jīng)為你完成:http://www.php.net/manual/en/function.http-negotiate-language.php

                If you have PECL the whole job is already done for you: http://www.php.net/manual/en/function.http-negotiate-language.php

                我不知道為什么其他答案都用于 User-Agent 標(biāo)頭;這完全是假的.User-Agent 沒有被強(qiáng)制要求在任何特定的地方保存語(yǔ)言值,對(duì)于某些瀏覽器(例如 Opera 和一些我從未聽說(shuō)過(guò)的名為Internet Explorer"的小瀏覽器),它根本不會(huì).它確實(shí)包含一種語(yǔ)言,這將是瀏覽器構(gòu)建所使用的語(yǔ)言,而不是您應(yīng)該查看的用戶首選語(yǔ)言.(此設(shè)置將默認(rèn)為構(gòu)建語(yǔ)言,但用戶可以通過(guò)首選項(xiàng) UI 進(jìn)行自定義.)

                I don't know why the other answers are going for the User-Agent header; this is utterly bogus. User-Agent is not mandated to hold a language value in any particular place, and for some browsers (eg. Opera, and some minor browser I've never heard of called ‘Internet Explorer’) it will not at all. Where it does contain a language, that'll be the of language the browser build was installed in, not the user's preferred language which is what you should be looking at. (This setting will default to the build language, but can be customised by the user from the preferences UI.)

                這篇關(guān)于通過(guò) PHP 檢查瀏覽器的語(yǔ)言?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動(dòng)游標(biāo)不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)
                  <legend id='YKc7g'><style id='YKc7g'><dir id='YKc7g'><q id='YKc7g'></q></dir></style></legend>
                    <bdo id='YKc7g'></bdo><ul id='YKc7g'></ul>

                            <tbody id='YKc7g'></tbody>
                          <i id='YKc7g'><tr id='YKc7g'><dt id='YKc7g'><q id='YKc7g'><span id='YKc7g'><b id='YKc7g'><form id='YKc7g'><ins id='YKc7g'></ins><ul id='YKc7g'></ul><sub id='YKc7g'></sub></form><legend id='YKc7g'></legend><bdo id='YKc7g'><pre id='YKc7g'><center id='YKc7g'></center></pre></bdo></b><th id='YKc7g'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='YKc7g'><tfoot id='YKc7g'></tfoot><dl id='YKc7g'><fieldset id='YKc7g'></fieldset></dl></div>
                          <tfoot id='YKc7g'></tfoot>

                          <small id='YKc7g'></small><noframes id='YKc7g'>

                        • 主站蜘蛛池模板: 午夜在线小视频 | 99精品观看 | 久久精品一级 | 日韩精品一区二区三区在线播放 | 美女久久久久久久久 | 欧美三区视频 | 亚洲激情网站 | 91在线精品视频 | 99久久精品免费看国产免费软件 | 高清视频一区二区三区 | 国产大学生情侣呻吟视频 | 欧美中文字幕一区二区三区亚洲 | 欧美aaaaa| 91精品国产91久久久久久三级 | 成人欧美一区二区 | 国产高清在线 | 午夜精品91| 91av在线免费观看 | 久久久久国产 | www..99re| 久久亚洲一区二区 | 精品99爱视频在线观看 | 欧美日韩精品专区 | 亚洲视频免费观看 | 九九热精品视频在线观看 | 欧美一区二区三区久久精品视 | 国产精品日韩欧美一区二区三区 | 成人在线观看免费视频 | 日本一级淫片免费啪啪3 | 中文字幕二区 | 99欧美精品| 九九亚洲 | 欧美综合一区二区 | av资源中文在线 | 欧美成人在线影院 | 久久这里只有精品首页 | 日韩欧美国产一区二区三区 | av性色全交蜜桃成熟时 | 性色av网站 | 精品国产一区二区在线 | av国产精品毛片一区二区小说 |