php indexof -> strpos, 문자열이 있는지 체크해준다
ex)
$deviceInfo = "android";
$u_agent = $_SERVER['HTTP_USER_AGENT'];
//echo $u_agent."<br>";
$pos1 = strpos($u_agent, "Android");
$pos2 = strpos($u_agent, "android");
if($pos1==true || $pos2==true) {
//ANDROID
//echo "android";
$deviceInfo = "android";
} else {
//IOS
//echo "ios";
$deviceInfo = "ios";
}
접속 브라우저가 안드로이드인지, 애플의 IOS인지를 분별해줘요
have a nice day~