3 function detect_device($value){
5 echo $iPod = preg_match("/iPod/i", $value);
6 echo $iPhone = preg_match("/iPhone/i", $value);
8 echo $iPad = preg_match("/iPad/i", $value);
9 // $Android = stripos($value,"Android");
10 echo $webOS = (preg_match("/Safari/i",$value)) ?
2 : 0;
11 //do something with this information
12 $finalBreaker = $breaker+
$webOS+
$iPhone+
$iPod+
$iPad;
13 echo "<br> finalBreaker: ".$finalBreaker."<br>";
22 echo " Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D257 <br>";
23 // echo $_SERVER['REMOTE_ADDR']."<br>";
24 // echo detect_device("Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) Safari/537.51.2 (KHTML, like Gecko) Mobile/11D257)")."<br>";
25 if(detect_device("Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D257") == "PLSDISPLAY"){
26 // if(detect_device($_SERVER['HTTP_USER_AGENT']) == "PLSDISPLAY"){