<?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>iPhone &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/iphone/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Reading GPS Latitude and Longitude from Image and Video Files</title>
		<link>/2011/02/04/reading-gps-latitude-and-longitude-from-image-and-video-files/</link>
		<comments>/2011/02/04/reading-gps-latitude-and-longitude-from-image-and-video-files/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 10:16:14 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Apple Inc.]]></category>
		<category><![CDATA[Application software]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Container formats]]></category>
		<category><![CDATA[Digital photography]]></category>
		<category><![CDATA[Exchangeable image file format]]></category>
		<category><![CDATA[ExifTool]]></category>
		<category><![CDATA[Geotagging]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[jpeg]]></category>
		<category><![CDATA[Metadata]]></category>
		<category><![CDATA[mobile device]]></category>
		<category><![CDATA[Mobile Devices]]></category>
		<category><![CDATA[MPEG-4]]></category>
		<category><![CDATA[navigation software]]></category>
		<category><![CDATA[Nokia E71 Smartphone]]></category>
		<category><![CDATA[QuickTime]]></category>
		<category><![CDATA[Resolution Unit]]></category>
		<category><![CDATA[Smartphones]]></category>
		<category><![CDATA[Symbian]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[web platform]]></category>

		<guid isPermaLink="false">/?p=2153</guid>
		<description><![CDATA[The State of GPS Data from Mobile Devices Most of the mobile devices today support GPS geo tagging. In fact most of them come bundled with navigation software that uses GPS and therefore all the pictures and (maybe) videos can be geo tagged. But as expected different vendors come with different support and formats. iPhone &#8230; <a href="/2011/02/04/reading-gps-latitude-and-longitude-from-image-and-video-files/" class="more-link">Continue reading <span class="screen-reader-text">Reading GPS Latitude and Longitude from Image and Video Files</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2011/01/27/few-thoughts-on-web-video/" rel="bookmark" title="Few Thoughts on Web Video">Few Thoughts on Web Video </a></li>
<li><a href="/2010/03/05/video-sites-must-use-mp4-and-only-mp4/" rel="bookmark" title="Video sites must use &#8230; mp4 and only mp4!">Video sites must use &#8230; mp4 and only mp4! </a></li>
<li><a href="/2010/05/25/download-files-with-zend-framework/" rel="bookmark" title="Download Files with Zend Framework">Download Files with Zend Framework </a></li>
<li><a href="/2010/05/21/check-youtube-video-existence-with-zend_gdata_youtube/" rel="bookmark" title="Check YouTube Video Existence with Zend_Gdata_YouTube">Check YouTube Video Existence with Zend_Gdata_YouTube </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>The State of GPS Data from Mobile Devices</h2>
<p>Most of the mobile devices today support GPS geo tagging. In fact most of them come bundled with navigation software that uses GPS and therefore all the pictures and (maybe) videos can be geo tagged. But as expected different vendors come with different support and formats.<br />
<br clear="all" /><a href="/wp-content/uploads/2011/02/iphone.png"><img class="alignleft size-full wp-image-2162" title="iphone" src="/wp-content/uploads/2011/02/iphone.png" alt="" width="120" height="78" /></a><br />
<br clear="all" /></p>
<p><a title="iPhone OS" href="http://en.wikipedia.org/wiki/IOS_%28Apple%29" target="_blank">iPhone OS</a> comes with geotagging both on video and image files, while the latest <a title="Android" href="http://www.android.com/" target="_blank">Android</a> and <a title="Symbian" href="http://blog.symbian.org/" target="_blank">Symbian</a> (the Nokia main OS for smartphones) can geo tag only images.</p>
<p>Even more &#8211; until recently Symbian didn&#8217;t support any geotagging before the installation of an additional software &#8211; such as <a title="Location Tagger" href="http://betalabs.nokia.com/apps/location-tagger" target="_blank">Location Tagger</a> . So generally the things are quite simple:</p>
<ol>
<li>iPhone OS geotags both video and image files;</li>
<li>Android geotags only images;</li>
<li>Symbian geotags only images &#8211; and on some devices this is possible only after installing a software;</li>
</ol>
<p>This is in breve the state of mobile device geotagging!<span id="more-2153"></span></p>
<h2>Why Use GPS Data?</h2>
<p>Perhaps one of the main reasons why not support geotagging especially on video files can be the usage of those geo tags. First of all what a geotag means?<br />
<br clear="all" /><br />
<a href="/wp-content/uploads/2011/02/android.png"><img class="alignleft size-full wp-image-2165" title="android" src="/wp-content/uploads/2011/02/android.png" alt="Android Logo" width="150" height="150" /></a><br />
<br clear="all" /><br />
You may know that even Android doesn&#8217;t &#8220;geotag&#8221; videos this is not quite true. Because after using you gallery you can see where those videos are shot. This is fantastic, but actually the real information about where the video has been taken is not into the video file, but it&#8217;s in an additional log file that keeps it. Thus actually the video files doesn&#8217;t know the geo coordinates.</p>
<p>Here comes the problem with video format, because you cannot be sure that every format supports tags that can keep geo coordinates. Actually quicktime&#8217;s MOV can store them, while Symbian&#8217;s 3GP cannot. In fact Symbian cannot store any geo information about video files!</p>
<p>So now we&#8217;ve at least three different formats for each of those three vendors.</p>
<ol>
<li>quicktime for iPhone</li>
<li>mpeg-4 with Android</li>
<li>3gp with Symbian</li>
</ol>
<p>For now I can only say that iPhone can keep the geotag into his video files.<br />
<br clear="all" /><br />
<a href="/wp-content/uploads/2011/02/symbian.png"><img class="alignleft size-full wp-image-2164" title="symbian" src="/wp-content/uploads/2011/02/symbian.png" alt="Symbian Logo" width="200" height="55" /></a><br />
<br clear="all" /><br />
But let me return to the question &#8211; why we need this geo tags? Until the video file is on the mobile device &#8211; there&#8217;s no problem. But once you try to download it &#8211; whether on <a title="Flickr" href="http://www.flickr.com/" target="_blank">Flickr</a>, <a title="YouTube" href="http://youtube.com/" target="_blank">YouTube</a>, <a title="Picasa Web Albums" href="https://picasaweb.google.com/" target="_blank">Picasa</a>, etc. you&#8217;ll lose any geo information if it&#8217;s not into the file tags. And of course if the above sites can&#8217;t read it!</p>
<p>The general reason to store this data into the file is to move it along with the file. Once you move this file from your mobile device to a web platform you&#8217;ll see where the file has been created.</p>
<h2>EXIF, Exiftool and PHP&#8217;s exif_read_data</h2>
<p>There are several tools to read geotags. For images, and here we talk only for JPEGs, this is the <a title="EXIF" href="http://www.exif.org/" target="_blank">EXIF</a> information. You can download the exif command line program and try to reed data with it:</p>
<pre lang="bash">
exif filename.jpg
</pre>
<p>Which can result in something like that:</p>
<pre lang="bash">
Manufacturer        |Nokia                                                     
Model               |E71                                                       
Orientation         |top - left                                                
x-Resolution        |300.00                                                    
y-Resolution        |300.00                                                    
Resolution Unit     |Inch                                                      
YCbCr Positioning   |centered                                                  
Compression         |JPEG compression                                          
x-Resolution        |72.00                                                     
y-Resolution        |72.00                                                     
Resolution Unit     |Inch                                                      
FNumber             |f/3.2                                                     
Exif Version        |Exif Version 2.2                                          
Date and Time (origi|2011:01:24 12:15:01                                       
Date and Time (digit|2011:01:24 12:15:01                                       
ComponentsConfigurat|Y Cb Cr -                                                 
Aperture            |3.20 EV (f/3.0)                                           
Light Source        |0                                                         
Flash               |Flash did not fire, auto mode.                            
Focal Length        |4.9 mm                                                    
FlashPixVersion     |FlashPix Version 1.0                                      
Color Space         |sRGB                                                      
PixelXDimension     |2048                                                      
PixelYDimension     |1536                                                      
Custom Rendered     |Normal process                                            
Exposure Mode       |Auto exposure                                             
White Balance       |Auto white balance                                        
Digital Zoom Ratio  |1.00                                                      
Scene Capture Type  |Standard                                                  
GPS tag version     |0x02, 0x02, 0x00, 0x00                                    
North or South Latit|N                                                         
Latitude            |42.00, 39.00, 24.67                                       
East or West Longitu|E                                                         
Longitude           |23.00, 21.00, 28.45                                       
Altitude reference  |0x00                                                      
Altitude            |625.50 
</pre>
<p>While for video files (iPhone) exif cannot help you, this is possible through <a title="Exiftool" href="http://www.sno.phy.queensu.ca/~phil/exiftool/" target="_blank">Exiftool</a>. With it you can read even iPhone video geotags:</p>
<pre lang="bash">
./exiftool filname.mov
</pre>
<p>In addition this information can be read with PHP via <a title="read_exif_data" href="http://php.net/manual/en/function.read-exif-data.php" target="_blank">exif_read_data</a>:</p>
<pre lang="php">
$info = exif_read_data('filename.jpg');
var_dump($info);
</pre>
<p>And this will give you not only standard tags, but geo tags too.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2011/01/27/few-thoughts-on-web-video/" rel="bookmark" title="Few Thoughts on Web Video">Few Thoughts on Web Video </a></li>
<li><a href="/2010/03/05/video-sites-must-use-mp4-and-only-mp4/" rel="bookmark" title="Video sites must use &#8230; mp4 and only mp4!">Video sites must use &#8230; mp4 and only mp4! </a></li>
<li><a href="/2010/05/25/download-files-with-zend-framework/" rel="bookmark" title="Download Files with Zend Framework">Download Files with Zend Framework </a></li>
<li><a href="/2010/05/21/check-youtube-video-existence-with-zend_gdata_youtube/" rel="bookmark" title="Check YouTube Video Existence with Zend_Gdata_YouTube">Check YouTube Video Existence with Zend_Gdata_YouTube </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2011/02/04/reading-gps-latitude-and-longitude-from-image-and-video-files/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Stop Coding iPhone Apps, Begin with HTML5 Mobile Sites</title>
		<link>/2010/03/17/stop-coding-iphone-apps-begin-with-html5-mobile-sites/</link>
		<comments>/2010/03/17/stop-coding-iphone-apps-begin-with-html5-mobile-sites/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 14:55:45 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[mobile site]]></category>
		<category><![CDATA[ppk]]></category>
		<category><![CDATA[smart phones]]></category>

		<guid isPermaLink="false">/?p=1347</guid>
		<description><![CDATA[PPK is right! Stop developing everything as a iPhone app. First that doesn&#8217;t work on any device except iPhone and it&#8217;s difficult to maintain. In reverse you should begin doing your mobile web site version. Hopefully with HTML5. Do as Twitter did &#8230; or you&#8217;d be looking at http://m.digg.com/ &#8211; that&#8217;s the right way.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/03/10/change-the-viewport-be-ready-for-the-iphone/" rel="bookmark" title="Change the Viewport, be Ready for the iPhone!">Change the Viewport, be Ready for the iPhone! </a></li>
<li><a href="/2010/03/26/html5-makes-mobile-browsing-fun/" rel="bookmark" title="HTML5 Makes Mobile Browsing Fun">HTML5 Makes Mobile Browsing Fun </a></li>
<li><a href="/2010/03/09/php-detecting-mobile-device/" rel="bookmark" title="PHP: detecting mobile device">PHP: detecting mobile device </a></li>
<li><a href="/2010/03/18/mobile-internet-users-are-getting-more-important/" rel="bookmark" title="Mobile Internet Users are Getting More Important">Mobile Internet Users are Getting More Important </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p><a title="HTML5 apps" href="http://www.quirksmode.org/blog/archives/2010/03/html5_apps.html" target="_blank">PPK</a> is right! Stop developing everything as a iPhone app. First that doesn&#8217;t work on any device except iPhone and it&#8217;s difficult to maintain. In reverse you should begin doing your mobile web site version. Hopefully with HTML5.</p>
<p>Do as <a title="twitter" href="http://twitter.com/" target="_blank">Twitter</a> did &#8230; or you&#8217;d be looking at <a title="Mobile Digg" href="http://m.digg.com/" target="_blank">http://m.digg.com/</a> &#8211; that&#8217;s the right way.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/03/10/change-the-viewport-be-ready-for-the-iphone/" rel="bookmark" title="Change the Viewport, be Ready for the iPhone!">Change the Viewport, be Ready for the iPhone! </a></li>
<li><a href="/2010/03/26/html5-makes-mobile-browsing-fun/" rel="bookmark" title="HTML5 Makes Mobile Browsing Fun">HTML5 Makes Mobile Browsing Fun </a></li>
<li><a href="/2010/03/09/php-detecting-mobile-device/" rel="bookmark" title="PHP: detecting mobile device">PHP: detecting mobile device </a></li>
<li><a href="/2010/03/18/mobile-internet-users-are-getting-more-important/" rel="bookmark" title="Mobile Internet Users are Getting More Important">Mobile Internet Users are Getting More Important </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/03/17/stop-coding-iphone-apps-begin-with-html5-mobile-sites/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Change the Viewport, be Ready for the iPhone!</title>
		<link>/2010/03/10/change-the-viewport-be-ready-for-the-iphone/</link>
		<comments>/2010/03/10/change-the-viewport-be-ready-for-the-iphone/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 15:07:08 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[.mobi]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Digg]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[HTML element]]></category>
		<category><![CDATA[Human Interest]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[less decorated site]]></category>
		<category><![CDATA[Meta element]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Opera Mini]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">/?p=1247</guid>
		<description><![CDATA[Sites for mobile Have you ever noticed that once you start designing a site for mobile, as iPhone and Nexus One from Google are, the site is looking really ugly! These two devices in particular, as may other using Opera Mini for instance, scale the site, because only than you can view the entire layout &#8230; <a href="/2010/03/10/change-the-viewport-be-ready-for-the-iphone/" class="more-link">Continue reading <span class="screen-reader-text">Change the Viewport, be Ready for the iPhone!</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/03/17/stop-coding-iphone-apps-begin-with-html5-mobile-sites/" rel="bookmark" title="Stop Coding iPhone Apps, Begin with HTML5 Mobile Sites">Stop Coding iPhone Apps, Begin with HTML5 Mobile Sites </a></li>
<li><a href="/2010/03/22/php-mobile-devices-http_user_agent-strings/" rel="bookmark" title="PHP: Mobile Devices HTTP_USER_AGENT Strings">PHP: Mobile Devices HTTP_USER_AGENT Strings </a></li>
<li><a href="/2010/01/31/speed-up-the-javascript-it-can-change-dramatically-the-user-experience/" rel="bookmark" title="Speed up the JavaScript. It can change dramatically the user experience.">Speed up the JavaScript. It can change dramatically the user experience. </a></li>
<li><a href="/2010/08/03/html-tags/" rel="bookmark" title="HTML Tags: &lt;base&gt;">HTML Tags: &lt;base&gt; </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Sites for mobile</h2>
<p>Have you ever noticed that once you start designing a site for mobile, as <a title="Apple iPhone" href="http://www.apple.com/iphone/" target="_blank">iPhone</a> and <a title="Nexus One from Google" href="http://www.google.com/phone/" target="_blank">Nexus One</a> from Google are, the site is looking really ugly! These two devices in particular, as may other using <a title="Opera Mini" href="http://www.opera.com/mini/" target="_blank">Opera Mini</a> for instance, scale the site, because only than you can view the entire layout and than zoom to a particular part of the page.</p>
<p>This is nice because news sites as <a title="CNN" href="http://cnn.com/" target="_blank">cnn.com</a> or <a title="Le Monde France" href="http://lemonde.fr/" target="_blank">lemonde.fr</a> are full of text &amp; image information and once zoomed in they fit the screen &#8211; very nice feature of the browsers. However if you&#8217;d like to design a site for mobile the bad part comes here. Yeah you know how to detect the browser, that was a topic of one of my previous posts, but even than you fully functional, but less decorated site is scaled again and looks more ugly than the full version of the site.</p>
<p><a href="/wp-content/uploads/2010/03/mobile.twitter.png"><img class="aligncenter size-full wp-image-1248" title="mobile.twitter" src="/wp-content/uploads/2010/03/mobile.twitter.png" alt="Twitter for mobile" width="320" height="480" srcset="/wp-content/uploads/2010/03/mobile.twitter.png 320w, /wp-content/uploads/2010/03/mobile.twitter-200x300.png 200w" sizes="(max-width: 320px) 100vw, 320px" /></a></p>
<h2>How to make a site visible in mobile &#8230;</h2>
<p>Look at the <a title="Mobile Twitter" href="http://mobile.twitter.com/" target="_blank">http://mobile.twitter.com/</a> &#8211; the problem is that if you open this link with a normal browser, not from mobile, you&#8217;ll get redirected to the twitter.com and you cannot see the difference.</p>
<h2>You can see how it&#8217;s made on &#8230;</h2>
<p>The digg&#8217;s mobile version. Look at <a title="Digg for mobile" href="http://m.digg.com/" target="_blank">http://m.digg.com/</a>. This time you can see the different approach just by looking at the source code. Pay attention to meta tag in the head &#8211; it simply says &#8211; &#8220;don&#8217;t scale&#8221;. Nice thing to notice!</p>
<p>Don&#8217;t scale my site anymore:</p>
<pre lang="html4strict" escaped="true">&lt;html&gt;
 &lt;head&gt;
  &lt;meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/&gt;
 &lt;/head&gt;
...
&lt;/html&gt;</pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/03/17/stop-coding-iphone-apps-begin-with-html5-mobile-sites/" rel="bookmark" title="Stop Coding iPhone Apps, Begin with HTML5 Mobile Sites">Stop Coding iPhone Apps, Begin with HTML5 Mobile Sites </a></li>
<li><a href="/2010/03/22/php-mobile-devices-http_user_agent-strings/" rel="bookmark" title="PHP: Mobile Devices HTTP_USER_AGENT Strings">PHP: Mobile Devices HTTP_USER_AGENT Strings </a></li>
<li><a href="/2010/01/31/speed-up-the-javascript-it-can-change-dramatically-the-user-experience/" rel="bookmark" title="Speed up the JavaScript. It can change dramatically the user experience.">Speed up the JavaScript. It can change dramatically the user experience. </a></li>
<li><a href="/2010/08/03/html-tags/" rel="bookmark" title="HTML Tags: &lt;base&gt;">HTML Tags: &lt;base&gt; </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/03/10/change-the-viewport-be-ready-for-the-iphone/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP: detecting mobile device</title>
		<link>/2010/03/09/php-detecting-mobile-device/</link>
		<comments>/2010/03/09/php-detecting-mobile-device/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 09:37:16 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[FTP clients]]></category>
		<category><![CDATA[Gecko]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Mac OS X 10.5]]></category>
		<category><![CDATA[Mach]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Mozilla Firefox]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[Steve Jobs]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[United States]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">/?p=1214</guid>
		<description><![CDATA[HTTP_USER_AGENT Beside that most of the responses of $_SERVER[&#8216;HTTP_USER_AGENT&#8217;] may return, it appears that this is the most reliable way to track down a user agent with PHP. It is weird that most of the clients, i.e. Safari and Chrome will return something with Mozilla in it&#8217;s strings, but however it&#8217;s enough to track the &#8230; <a href="/2010/03/09/php-detecting-mobile-device/" class="more-link">Continue reading <span class="screen-reader-text">PHP: detecting mobile device</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/03/22/php-mobile-devices-http_user_agent-strings/" rel="bookmark" title="PHP: Mobile Devices HTTP_USER_AGENT Strings">PHP: Mobile Devices HTTP_USER_AGENT Strings </a></li>
<li><a href="/2010/03/18/mobile-internet-users-are-getting-more-important/" rel="bookmark" title="Mobile Internet Users are Getting More Important">Mobile Internet Users are Getting More Important </a></li>
<li><a href="/2010/02/24/storing-javascript-objects-in-html5-localstorage/" rel="bookmark" title="Storing JavaScript objects in html5 localStorage">Storing JavaScript objects in html5 localStorage </a></li>
<li><a href="/2010/03/17/stop-coding-iphone-apps-begin-with-html5-mobile-sites/" rel="bookmark" title="Stop Coding iPhone Apps, Begin with HTML5 Mobile Sites">Stop Coding iPhone Apps, Begin with HTML5 Mobile Sites </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>HTTP_USER_AGENT</h2>
<p>Beside that most of the responses of <strong>$_SERVER[&#8216;HTTP_USER_AGENT&#8217;]</strong> may return, it appears that this is the most reliable way to track down a user agent with PHP. It is weird that most of the clients, i.e. Safari and Chrome will return something with Mozilla in it&#8217;s strings, but however it&#8217;s enough to track the &#8220;chrome&#8221; or &#8220;safari&#8221; sub strings.</p>
<p>All the examples bellow are from Mac OS X:</p>
<p>Firefox 3.6:</p>
<pre lang="html">
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
</pre>
<p><em><strong>Note</strong>: there are both Mozilla and Firefox sub strings!</em></p>
<p>Safari 4:</p>
<pre lang="html">
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; bg-bg) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10
</pre>
<p>Chrome:</p>
<pre lang="html">
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.307.11 Safari/532.9
</pre>
<p><em><strong>Note</strong>: Here they are Mozilla, Chorme and Safari!!!</em></p>
<p>Opera:</p>
<pre lang="html">
Opera/9.80 (Macintosh; Intel Mac OS X; U; en) Presto/2.2.15 Version/10.10
</pre>
<h2>The day of mobile</h2>
<p>Nowadays it&#8217;s normal to make a site with the presumption it will be visible from mobile. The war between Nexus One from Google and iPhone from Apple is just beginning and with all those devices with wide screens everything&#8217;s becoming more complicated.</p>
<h2>User agent strings from Nexus One and iPhone</h2>
<p>Both are weird, but both contain the keyword &#8211; &#8220;mobile&#8221; and that may help you make a check with something like this PHP snippet:</p>
<pre lang="php">
<?php
$mobile = !!(FALSE !== strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile'));
?>
</pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/03/22/php-mobile-devices-http_user_agent-strings/" rel="bookmark" title="PHP: Mobile Devices HTTP_USER_AGENT Strings">PHP: Mobile Devices HTTP_USER_AGENT Strings </a></li>
<li><a href="/2010/03/18/mobile-internet-users-are-getting-more-important/" rel="bookmark" title="Mobile Internet Users are Getting More Important">Mobile Internet Users are Getting More Important </a></li>
<li><a href="/2010/02/24/storing-javascript-objects-in-html5-localstorage/" rel="bookmark" title="Storing JavaScript objects in html5 localStorage">Storing JavaScript objects in html5 localStorage </a></li>
<li><a href="/2010/03/17/stop-coding-iphone-apps-begin-with-html5-mobile-sites/" rel="bookmark" title="Stop Coding iPhone Apps, Begin with HTML5 Mobile Sites">Stop Coding iPhone Apps, Begin with HTML5 Mobile Sites </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/03/09/php-detecting-mobile-device/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
