I wonder if there is a way to recognize an iphone user’s visit and automatically adjust the web page to fit the iPhone screen size?
<?php $isIphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone"); if ($isIphone == true) { echo 'Code You Want To Execute'; } ?>
I would say that instead of basing it on UA, often asking for screen size is better. I used it before in mine head.
head
<!--[if !IE]>--> <link type="text/css" rel="stylesheet" media="only screen and (max-device-width: 480px)" href="iPhone.css"> <!--<![endif]-->
, . User-Agent HTTP- - .
User-Agent
You can perform User-Agent discovery and make changes depending on the look of the iPhone or iPod string, but you can also use the meta tag specifically for this purpose .
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
Here is another good resource for information on creating an iPhone-ready website .
Source: https://habr.com/ru/post/1736111/More articles:Optimistic blocking and HTTP header If-Match - httpTechnique for limiting the number of instances of our application in Terminal Server - pythonOpen form for node / add with established taxonomies, no user changes required - formsCan I create thumbnails of MS Office files? - ms-officeHow does PHP track created objects? - oopPerformance Improvement System.DirectoryServices.AccountManagement - performanceПолучить информацию о Predicate - reflectiongit add except 1 folder - gitWhy do some cmd start block / buffer output processes when redirecting output? - command-lineGetting server IP address in WCF? - .netAll Articles