redirect to page only once every 24 hour using mobiledetect script in php
<p>I have the following code :</p>

<pre><code>include("Mobile_Detect.php");

$detect = new Mobile_Detect();
if ($detect-&gt;isMobile()) {
$parsedUrll = curPageURL();
$wwwtom = str_replace("www", "m", $parsedUrll);
header("location: $wwwtom");
exit;
}
</code></pre>

<p>Which redirects website visitors to the mobile website if they are using a mobile device. the problem is that the code redirects all the time making it impossible for mobile users to access the computer website. 
I want the mobile users to have the option to go back to the normal website if they clicked on a button. but I cannot really do that because of the redirection code that I have now. How can I fix the code, so it will only redirect once every 24 hours.
suggestions, ideas, solution, all are welcome.</p>
