Php 检测并重定向设备和操作系统

Php 检测并重定向设备和操作系统,php,android,ios,windows,macos,Php,Android,Ios,Windows,Macos,我想检测windows、mac os x、android ios和windows phone,并使用javascript或php重定向到相关页面。 我正在尝试将设备和操作系统检测脚本与这个mobile detect js插件一起使用,但我不知道如何检测windows和mac桌面用户 function deviceDetectionScript() { var md = new MobileDetect(window.navigator.userAgent); if (md.mobile()

我想检测windows、mac os x、android ios和windows phone,并使用javascript或php重定向到相关页面。 我正在尝试将设备和操作系统检测脚本与这个mobile detect js插件一起使用,但我不知道如何检测windows和mac桌面用户

function deviceDetectionScript() {

var md = new MobileDetect(window.navigator.userAgent);

if (md.mobile() && md.phone() && md.tablet()) {

    If(ios) {

        //do something

    }
    If(android) {

        //do something

    }
    If(windows) {

        //do something

    }
If(macOSX) {

        //if mac OS X (desktop)

    }
If(windows) {

        //windows desktop users

    }



} else {

    // do something else
}
}

谢谢