...

View Full Version : PLEASE HELP! Detect safari browser with php GOING INSANE! ><



ShadowIce
02-06-2010, 09:28 PM
Can someone please tell me how I can fix this so it detects ONLY the string "Safari" from within the user agent string
and not "Safari/REPLACE THIS PART OF THE STRING WITH THE VERSION HERE"?


<?php
function is_safari(){
if(strstr($_SERVER['HTTP_USER_AGENT'], "Safari")){
return true;
}else{
return false;
}
}
if(! is_safari()){
echo "<td>\r\n";
}else{
echo "hello!\r\n";
}
?>

JAY6390
02-06-2010, 09:59 PM
have you tried using the get_browser() (http://www.php.net/get_browser) function?

ShadowIce
02-06-2010, 10:50 PM
Nvm, solved



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum