【问题标题】:open url in external browser instead of in-app mobile browser using php for ios使用 php for ios 在外部浏览器而不是应用内移动浏览器中打开 url
【发布时间】:2021-12-07 19:33:20
【问题描述】:

我正在使用下面的代码,该代码在 android 手机上运行良好,但在 ios 上不运行。 在 ios 上实现这一目标的完美方法是什么?

$userAgent = $_SERVER['HTTP_USER_AGENT'];
if (strpos($userAgent, 'Instagram')) {
    header('Content-type: application/pdf');
    header('Content-Disposition: inline; filename= test');
    header('Content-Transfer-Encoding: binary');
    header('Accept-Ranges: bytes');
    @readfile($file);
}
else{
    header('Location: index.php');
}

我想在移动应用的外部浏览器上打开 index.php

【问题讨论】:

    标签: php android ios mobile user-agent


    【解决方案1】:

    PHP 在服务器端运行,而不是在 iOS 设备上。

    您可以只使用主页 URL,它默认运行 index.php 文件的代码吗?

    header('Location: siteaddress.com');

    【讨论】:

    • 我的代码在 Android 移动设备上运行正常,但在 ios 设备上运行不正常。主要问题是我不想使用 Instagram 的应用内浏览器。每当我的链接被点击时,我都想使用 chrome 浏览器
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-01
    • 2015-12-31
    • 2015-04-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多