<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MaggsWeb:7 &#187; mobile browser</title>
	<atom:link href="http://www.maggsweb.com/tag/mobile-browser/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maggsweb.com</link>
	<description>www.maggsweb.com</description>
	<lastBuildDate>Fri, 03 Feb 2012 22:50:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Detecting a mobile browser</title>
		<link>http://www.maggsweb.com/php/detecting-a-mobile-browser/</link>
		<comments>http://www.maggsweb.com/php/detecting-a-mobile-browser/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 12:16:07 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[mobile browser]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=226</guid>
		<description><![CDATA[I have often looked at my sites on my mobile.  Some look good, others look really bad &#8211; usually down to some clever fancy-arse stuff that wouldn&#8217;t even work on a mobile. So, I have finally found this article that reckons it is sussed.  I&#8217;m gonna try it out. ?View Code PHP&#60;?php if&#40;checkmobile&#40;&#41;&#41; &#123; header&#40;&#34;Location:http://www.whatever-url-you-want.com&#34;&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>I have often looked at my sites on my mobile.  Some look good, others look really bad &#8211; usually down to some clever fancy-arse stuff that wouldn&#8217;t even work on a mobile.</p>
<p>So, I have finally found this <a href="http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.brainhandles.com/techno-thoughts/detecting-mobile-browsers?referer=');">article</a> that reckons it is sussed.  I&#8217;m gonna try it out.<br />
<span id="more-226"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p226code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2262"><td class="code" id="p226code2"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>checkmobile<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a href="http://www.php.net/header" onclick="pageTracker._trackPageview('/outgoing/www.php.net/header?referer=');"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location:http://www.whatever-url-you-want.com&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Use like this....</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> checkmobile<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset" onclick="pageTracker._trackPageview('/outgoing/www.php.net/isset?referer=');"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_X_WAP_PROFILE&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/preg_match" onclick="pageTracker._trackPageview('/outgoing/www.php.net/preg_match?referer=');"><span style="color: #990000;">preg_match</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/wap\.|\.wap/i&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_ACCEPT&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset" onclick="pageTracker._trackPageview('/outgoing/www.php.net/isset?referer=');"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_USER_AGENT&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/preg_match" onclick="pageTracker._trackPageview('/outgoing/www.php.net/preg_match?referer=');"><span style="color: #990000;">preg_match</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/Creative\ AutoUpdate/i&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_USER_AGENT&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$uamatches</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array" onclick="pageTracker._trackPageview('/outgoing/www.php.net/array?referer=');"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;midp&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;j2me&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;avantg&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;docomo&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;novarra&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;palmos&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;palmsource&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;240x320&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;opwv&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;chtml&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;pda&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;windows\ ce&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;mmp\/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;blackberry&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;mib\/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;symbian&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;wireless&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;nokia&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;hand&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;mobi&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;phone&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;cdm&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;up\.b&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;audio&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;SIE\-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;SEC\-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;samsung&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;HTC&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;mot\-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;mitsu&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sagem&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sony&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;alcatel&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;lg&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;erics&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;vx&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;NEC&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;philips&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;mmm&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;xx&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;panasonic&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sharp&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;wap&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;sch&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;rover&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;pocket&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;benq&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;java&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;pt&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;pg&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;vox&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;amoi&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;bird&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;compal&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;kg&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;voda&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sany&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;kdd&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;dbt&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sendo&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sgh&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;gradi&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;jb&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;\d\d\di&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;moto&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uamatches</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$uastring</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/preg_match" onclick="pageTracker._trackPageview('/outgoing/www.php.net/preg_match?referer=');"><span style="color: #990000;">preg_match</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$uastring</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/i&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_USER_AGENT&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/php/detecting-a-mobile-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

