frankyonnetti
7/7/2013 - 8:34 PM

#iOS #php If an iPhone web app

PHP - if an iPhone web app #iOS #php

<?php
	if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"iphone")) {
	   if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"safari")) {
	      echo('Running in browser on iPhone');
	   } else {
	      echo ('Running as stand alone WebApp on iPhone');
	   }
	} else {
	   echo ('Running on device other than iPhone.');
	}
?>