I have a function that can return the current devices. the devices are as follows {code ...} then I have a function to determine which devices are currently available. for example, the currently available devices include {code ...} the requirement is that when the current device is determined to be a mobile device, if the mobile device does not exist, then... I have a function that returns the current devices. the devices are as follows:
$page_style_default = array('pc','mobile','weixin','pad','pc_old','mobile_old','pc_soft','mobile_soft');
Then I have a function to determine which devices are currently available.
For example, the currently available devices have
array('pc','pad');
The requirement is that, when the current device is determined to be mobile, if the mobile device does not exist, the system determines that the pad exists and then calls the pad
If it is determined that the current device is mobile_old and only (pc and pad) is available, first determine whether there is mobile_old and then determine whether there is mobile and then whether there is a pad if there is no pad, final output pc
I don't know how to write if statements?
The hierarchical relationship is as follows:
Https://www.processon.com/view/577c5bafe4b04bc7eeac5bae
Reply content:
I have a function that returns the current devices. the devices are as follows:
$page_style_default = array('pc','mobile','weixin','pad','pc_old','mobile_old','pc_soft','mobile_soft');
Then I have a function to determine which devices are currently available.
For example, the currently available devices have
array('pc','pad');
The requirement is that, when the current device is determined to be mobile, if the mobile device does not exist, the system determines that the pad exists and then calls the pad
If it is determined that the current device is mobile_old and only (pc and pad) is available, first determine whether there is mobile_old and then determine whether there is mobile and then whether there is a pad if there is no pad, final output pc
I don't know how to write if statements?
The hierarchical relationship is as follows:
Https://www.processon.com/view/577c5bafe4b04bc7eeac5bae
Resolved,
Store an array of PCs and mobile devices separately, use in_array () to determine whether the current device exists, whether the current device belongs to the pc or mobile device, and then output the data in a unified manner.