$res    = check_agent();
print_r($res);

/*

제작자이름 : navyism
제작자메일 : navyism@chol.com
관련사이트 : http://navyism.com

*/

function check_agent()
{
    global
$HTTP_SERVER_VARS;

   
/*-----------------------------------------------------------------

    OS Pattern

    'keyword' => 'name',

    -----------------------------------------------------------------*/
   
$OS    = array(

       
/* PC */
       
array('Windows CE', 'Windows CE'),
        array(
'Win98', 'Windows 98'),
        array(
'Windows 9x', 'Windows ME'),
        array(
'Windows me', 'Windows ME'),
        array(
'Windows 98', 'Windows 98'),
        array(
'Windows 95', 'Windows 95'),
        array(
'Windows NT 6', 'Windows Vista'),
        array(
'Windows NT 5.2', 'Windows 2003/XP x64'),
        array(
'Windows NT 5.01', 'Windows 2000 SP1'),
        array(
'Windows NT 5.1', 'Windows XP'),
        array(
'Windows NT 5', 'Windows 2000'),
        array(
'Windows NT', 'Windows NT'),
        array(
'Macintosh', 'Macintosh'),
        array(
'Mac_PowerPC', 'Mac PowerPC'),
        array(
'Unix', 'Unix'),
        array(
'bsd', 'BSD'),
        array(
'Linux', 'Linux'),
        array(
'Wget', 'Linux'),
        array(
'windows', 'ETC Windows'),
        array(
'mac', 'ETC Mac'),

       
/* MOBILE */
       
array('PSP', 'PlayStation Portable'),
        array(
'Symbian', 'Symbian PDA'),
        array(
'Nokia', 'Nokia PDA'),
        array(
'LGT', 'LG Mobile'),
        array(
'mobile', 'ETC Mobile'),

       
/* WEB ROBOT */
       
array('Googlebot', 'GoogleBot'),
        array(
'OmniExplorer', 'OmniExplorerBot'),
        array(
'MJ12bot', 'majestic12Bot'),
        array(
'ia_archiver', 'Alexa(IA Archiver)'),
        array(
'Yandex', 'Yandex bot'),
        array(
'Inktomi', 'Inktomi Slurp'),
        array(
'Giga', 'GigaBot'),
        array(
'Jeeves', 'Jeeves bot'),
        array(
'Planetwide', 'IBM Planetwide bot'),
        array(
'bot', 'ETC Robot'),
        array(
'Crawler', 'ETC Robot'),
        array(
'library', 'ETC Robot'),

    );


   
/*-----------------------------------------------------------------

    Browser Pattern

    'keyword' => 'name',

    -----------------------------------------------------------------*/
   
$BW    = array(

       
/* BROWSER */
       
array('MSIE 2',    'InternetExplorer 2'),
        array(
'MSIE 3',    'InternetExplorer 3'),
        array(
'MSIE 4',    'InternetExplorer 4'),
        array(
'MSIE 5',    'InternetExplorer 5'),
        array(
'MSIE 6',    'InternetExplorer 6'),
        array(
'MSIE 7',    'InternetExplorer 7'),
        array(
'MSIE', 'ETC InternetExplorer'),
        array(
'Firefox', 'FireFox'),
        array(
'Safari', 'Safari'),
        array(
'Opera', 'Opera'),
        array(
'Lynx', 'Lynx'),
        array(
'LibWWW', 'LibWWW'),
        array(
'Konqueror', 'Konqueror'),
        array(
'Internet Ninja', 'Internet Ninja'),
        array(
'Download Ninja', 'Download Ninja'),
        array(
'WebCapture', 'WebCapture'),
        array(
'LTH', 'LTH Browser'),
        array(
'Gecko', 'Gecko compatible'),
        array(
'Mozilla', 'Mozilla compatible'),
        array(
'wget', 'Wget command'),

       
/* MOBILE */
       
array('PSP', 'PlayStation Portable'),
        array(
'Symbian', 'Symbian PDA'),
        array(
'Nokia', 'Nokia PDA'),
        array(
'LGT', 'LG Mobile'),
        array(
'mobile', 'ETC Mobile'),

       
/* WEB ROBOT */
       
array('Googlebot', 'GoogleBot'),
        array(
'OmniExplorer', 'OmniExplorerBot'),
        array(
'MJ12bot', 'majestic12Bot'),
        array(
'ia_archiver', 'Alexa(IA Archiver)'),
        array(
'Yandex', 'Yandex bot'),
        array(
'Inktomi', 'Inktomi Slurp'),
        array(
'Giga', 'GigaBot'),
        array(
'Jeeves', 'Jeeves bot'),
        array(
'Planetwide', 'IBM Planetwide bot'),
        array(
'bot', 'ETC Robot'),
        array(
'Crawler', 'ETC Robot'),

    );

    foreach(
$OS as $val)
    {
        if(
eregi($val[0], $_SERVER['HTTP_USER_AGENT']))
        {
           
$os_name    = $val[1];
            break;
        }
    }

    foreach(
$BW as $val)
    {
        if(
eregi($val[0], $_SERVER['HTTP_USER_AGENT']))
        {
           
$br_name    = $val[1];
            break;
        }
    }

   
$res    = array(

       
'os' => $os_name,
       
'br' => $br_name

   
);

    return
$res;
}




비슷한글 : http://haco.tistory.com/1414
Posted by 알 수 없는 사용자
,