search
HomeBackend DevelopmentPHP TutorialScan the same QR code to access different download addresses according to browser type, browser type_PHP tutorial

Scan the same QR code to access different download addresses according to the browser type, browser type

<span> 1</span> <?<span>php
</span><span> 2</span> 
<span> 3</span> <span>$Agent</span> = <span>$_SERVER</span>['HTTP_USER_AGENT'<span>];
</span><span> 4</span>     <span>preg_match</span>('/android|iphone/i',<span>$Agent</span>,<span>$matches</span><span>);
</span><span> 5</span>     <span>if</span> (<span>strtolower</span>(<span>$matches</span>[0]) == 'android'<span>)  {
</span><span> 6</span>         <span>//</span><span> echo "安卓";</span>
<span> 7</span>         <span>header</span>("Location: ".<span>$GLOBALS</span>["public_appconfig"]["app"]['android']."'"<span>);
</span><span> 8</span>     } <span>elseif</span> (<span>strtolower</span>(<span>$matches</span>[0]) == 'iphone'<span>) {
</span><span> 9</span>         <span>header</span>("'Location: ".<span>$GLOBALS</span>["public_appconfig"]["app"]['ios']."'"<span>);
</span><span>10</span>     }<span>else</span><span>{
</span><span>11</span>         <span>//</span><span>不确定是什么系统或者是pc</span>
<span>12</span>         <span>header</span>("Location: ".<span>$GLOBALS</span>["public_appconfig"]["app"]['android']."'"<span>);
</span><span>13</span> <span>    }
</span><span>14</span>    
<span>15</span>
<span>16</span> ?>

How can a string scanned by Java QR code be different from a URL? If it is a URL, how can I jump to the browser to access the URL?

Use regular expressions to determine whether it is a URL
and then use Intent to jump to the browser

Scan the QR code to download the installation file to the mobile phone. A QR code. How to tell whether the mobile phone is an IOS system or an ANDROID system?

You can put these two on the same website page, and then make the URL link into a QR code, so that people who need to download can choose to download, as shown below


Scan the same QR code to access different download addresses according to browser type, browser type_PHP tutorial

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/893872.htmlTechArticleScan the same QR code to access different download addresses according to the browser type, browser type 1? php 2 3 $ Agent = $_SERVER ['HTTP_USER_AGENT' ]; 4 preg_match ('/android|iphone/i', $Agen...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
火狐浏览器是哪个国家的火狐浏览器是哪个国家的Sep 15, 2022 pm 02:55 PM

火狐浏览器是“美国”的。Firefox火狐浏览器是开源基金组织Mozilla研发的一个自由及开放源代码的网页浏览器;而Mozilla基金会成立于2003年7月,是一家美国公司,现位于美国加利福尼亚州的芒廷维尤。

电脑浏览器打不开网页但能上网怎么解决电脑浏览器打不开网页但能上网怎么解决Jun 28, 2023 am 11:26 AM

电脑浏览器打不开网页但能上网解决方法:1、网络设置问题,将路由器断电并等待几分钟,然后再重新插上电源;2、浏览器设置问题,清除浏览器缓存和浏览历史记录,确保浏览器没有设置代理服务器或虚拟专用网络;3、DNS设置问题,将DNS设置更改为公共DNS服务器地址;4、杀毒软件或防火墙问题,禁用杀毒软件或防火墙,再尝试打开网页;5、网页本身的问题,等待一段时间或联系网站管理员了解情况。

如何修复 Microsoft Edge 浏览器中的黑屏问题如何修复 Microsoft Edge 浏览器中的黑屏问题May 16, 2023 am 10:04 AM

微软于2020年初发布了基于Chromium(谷歌的开源引擎)的NewEdge版本。新Edge的感觉与谷歌Chrome相似,并且具有Chrome中可用的功能。但是,许多用户报告说他们在启动MicrosoftNewEdge后立即看到黑屏。用户可以访问设置菜单,但是当他们单击菜单中的任何选项时,它不起作用,只有黑屏可见。当计算机鼠标悬停在选项上并且用户可以关闭浏览器时,它会突出显示选项。在PC上打开新的Edge浏览器时是否遇到黑屏?那么这篇文章将对你有用。在这篇文章中,

惠普打印机扫描怎么扫描成一个pdf惠普打印机扫描怎么扫描成一个pdfFeb 19, 2024 am 10:06 AM

很多用户使用惠普打印机扫描文件之后,想要直接扫描成一个pdf文件,但是不知道怎么样操作才能成功,只要在电脑中使用扫描仪程序就可以了。惠普打印机扫描怎么扫描成一个pdf:1、首先打开电脑上的扫描仪程序。2、然后在页面设置中选择“另存PDF”。3、然后在右下角按“扫描”开始扫描第一个文件。4、完成之后,点左下角的“+”图标,就可以增加新的扫描页面。5、就可以看到原本文件边上有新的扫描框。7、最后完成之后,选择“保存”就可以保存这些PDF文件了。

Win10如何使用WindowsDefender对文件夹进行扫描。Win10如何使用WindowsDefender对文件夹进行扫描。Jul 10, 2023 pm 11:17 PM

Windows10有一个免费的反病毒程序,叫做WindowsDefender,它提供了实时保护,可以在电脑上进行扫描。这也使您可以执行定制扫描,从而可以指定特定的文件夹或驱动器来扫描恶意软件。因为你只需要扫描这个文件夹,所以扫描的时间会比扫描整个机器要快很多。如下所示,我们为您的特定文件夹提供了两个定制扫描的方法。Win10是如何使用WindowsDefender来扫描文件夹中的恶意软件。若要扫描个别文件夹及其子文件夹,最简单的方式是右击该文件夹,然后选择「使用WindowsDefender扫描

edge是什么浏览器edge是什么浏览器Jul 19, 2022 pm 12:41 PM

edge是由微软开发的基于Chromium开源项目及其他开源软件的网页浏览器。Edge浏览器主要特点是能够支持目前主流的Web技术,作为Windows10自带浏览器,给微软用户带来更好的功能体验。

网易云音乐怎么扫描本地音乐_网易云音乐扫描本地音乐教程网易云音乐怎么扫描本地音乐_网易云音乐扫描本地音乐教程Mar 25, 2024 pm 10:21 PM

1、打开网易云音乐,点击我的,点击本地音乐。2、点击右上角的三个点。3、点击扫描本地音乐。4、点击下方的扫描设置。5、往左滑动过滤小于60秒的音频文件。6、返回点击全盘扫描,就可以扫描到全部的本地音乐的。

苹果自带的浏览器叫什么苹果自带的浏览器叫什么Jul 18, 2022 am 10:42 AM

苹果自带的浏览器叫“Safari”;Safari是一款由苹果公司开发的网页浏览器,是各类苹果设备的默认浏览器,该浏览器使用的是WebKit浏览器引擎,包含WebCore排版引擎及JavaScriptCore解析引擎,在GPL条约下授权,同时支持BSD系统的开发。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.