Warning: include_once(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/users/2/moriya-h5/web/confrage/php/access/browser/browser.php on line 2

Warning: include_once(http://www.confrage.com/bin/header.php): failed to open stream: no suitable wrapper could be found in /home/users/2/moriya-h5/web/confrage/php/access/browser/browser.php on line 2

Warning: include_once(): Failed opening 'http://www.confrage.com/bin/header.php' for inclusion (include_path='.:/usr/local/php/7.4/lib/php') in /home/users/2/moriya-h5/web/confrage/php/access/browser/browser.php on line 2
ユーザエージェント | PHP

Warning: include_once(/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/menu.php): failed to open stream: No such file or directory in /home/users/2/moriya-h5/web/confrage/php/access/browser/browser.php on line 27

Warning: include_once(): Failed opening '/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/menu.php' for inclusion (include_path='.:/usr/local/php/7.4/lib/php') in /home/users/2/moriya-h5/web/confrage/php/access/browser/browser.php on line 27
 
トップページ >  PHP >  ユーザエージェント
初版2008/11/21: 最終更新日2008/11/21
ユーザエージェント
目次
ユーザエージェント
サンプルコード
サンプル
ユーザエージェント
PHPでは、スーパーグローバル変数「$_SERVER[HTTP_USER_AGENT]」、
またはグローバル変数「HTTP_SERVER_VARS[HTTP_USER_AGENT]」を使うことにより、
そのページにアクセスしているユーザが使用しているブラウザの種類を調べることができます。

以下がサンプルになります。

サンプルコード
(php部)
<?php
// 閲覧しているブラウザ情報を取得して表示する。
print "$_SERVER[HTTP_USER_AGENT]";
?>
サンプル
お使いのブラウザのユーザエージェントです。
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)


Warning: include_once(/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/side_bar.php): failed to open stream: No such file or directory in /home/users/2/moriya-h5/web/confrage/php/access/browser/browser.php on line 98

Warning: include_once(): Failed opening '/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/side_bar.php' for inclusion (include_path='.:/usr/local/php/7.4/lib/php') in /home/users/2/moriya-h5/web/confrage/php/access/browser/browser.php on line 98