<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 17 May 2012 04:14:42 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Detecting user agents in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/13348</guid>
      <link>http://www.phpdeveloper.org/news/13348</link>
      <description><![CDATA[<p>
In <a href="http://www.codediesel.com/pear/detecting-user-agents-in-php/">a new post</a> to his blog today <i>Sameer</i> looks at a trick or two about detecting the type of browser/client a visitor is using to view your website - one method with the superglobal and another with a helpful PEAR package.
</p>
<blockquote>
Every time you use your browser to access a website a User-Agent header is sent to the respective server. Detecting user agents on the server can be useful for many reasons: browser quirks, personalize content, preventing illegal access. 
</blockquote>
<p>
He talks about the <a href="http://us2.php.net/manual/en/function.get-browser.php">get_browser</a> function that's included in PHP but that requires a browscap.ini file to work. His other option is the <a href="http://pear.php.net/package/net_useragent_detect/redirected">Net_UserAgent_Detect</a> PEAR package. It grabs the user agent and breaks it up into the browser type, operating system information and any Javascript-related headers that come along with it. There's also useful tests like "isIE()" and "isNetscape()" built into the package.
</p>]]></description>
      <pubDate>Wed, 07 Oct 2009 08:21:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DotVoid.com: Parsing the user agent string using PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7182</guid>
      <link>http://www.phpdeveloper.org/news/7182</link>
      <description><![CDATA[<p>
On the Dotvoid.com blog today, there's <a href="http://www.dotvoid.com/view.php?id=68">a new post</a> that shares some handy code to parse out information from the incoming user agent string for the visitors for your site.
</p>
<blockquote>
Recently I experimented a bit with an Apache log file analyzer written in PHP. It's not all that difficult were it not for trying to parse the browser, or user agent, string. [...] For my purposes I don't care much for the operating system details. This is the result so far. I'm still not very satisfied but I thought maybe other people might be interested and maybe help out.
</blockquote>
<p>
He <a href="http://www.dotvoid.com/view.php?id=68">provides the code</a> in the format of an encapsulated PHP function that returns the product they're using, the version number of the browser and other various comments.
</p>]]></description>
      <pubDate>Mon, 29 Jan 2007 15:11:57 -0600</pubDate>
    </item>
  </channel>
</rss>

