Hello Ruud, you did fix it and this works nice! But I think there's one final adjustment your code needs to be perfect:
If I include this code on the index.php template (normal site) it will ask the question about which version you want to see even if you visit from a desktop PC which obviously shouldn't happen.
So I think there should be condition first to show the question ONLY if you are visiting from a mobile, after a lot of trial and error I think I was able to do it

but I am not a programmer so if there's any potential risk of using this code please tell us!
Here's the code I use on my index.php file which I tested on my PC, android phone and android tablet and seems to work ok in case someone wants to use it and make it better:
<?php
if ($mobile = isMobile()) {
// create links
echo '<a href="?mobile">Mobile site</a> | <a href="?web">Normal site</a>';
}
$mobile = isMobile(); // check if the visitor uses mobile device (for first visit)
if (isset($_SESSION['mobile'])) $mobile = $_SESSION['mobile']; // check if previous mobile was used
if (isset($_GET['mobile'])) $mobile = true; // check if user wants mobile view
if (isset($_GET['web'])) $mobile = false; // check if user wants normal view
$_SESSION['mobile'] = $mobile; // store view setting for next page loading
if ($mobile) { // if mobile is wanted/needed use other php template
include ('mobile.php');
return;
}
?>
Hoping this is for use for the community...