U
U
unlik2018-01-30 20:14:19
PHP
unlik, 2018-01-30 20:14:19

File contents depending on the device?

In general, there are two files index.html and index2.html. It is
necessary that when opening the index.php file from desktops, the contents of index.html are loaded into it, and when opened from mobiles, index2.html is loaded.
This is done so that it does not depend on which devices open the site, the path was the same, but the versions of the site are different.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maksim Fedorov, 2018-01-30
@unlik

There is already a good solution:
mobiledetect.net
It will be something like this:

if ( $detect->isMobile() ) {
        include('youfile.html');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question