iframe不兼容,用PHP解决嵌套跳转问题,判断是否在快手打开

    技术2022-07-27  126

    PHP判断是否在某个软件打开

    以快手为例:

    index.php

    <?php $regex_match="/(Kwai|AllowKsCallApp)/i"; if (!preg_match($regex_match,strtolower($_SERVER['HTTP_USER_AGENT']))){ ?> <!--不是在快手打开--> <html> <head> <title></title> </head> <body> <p>页面代码</p> </body> </html> <?php }else{ ?> <html> <head> <title></title> </head> <body> <p>页面代码</p> </body> </html> <?php } ?>
    Processed: 0.014, SQL: 9