title: PHP include specific file if screen is touch device?
body: <p>I can use javascript to determine if the screen is touch device, but I can't translate that to PHP in order to include a specific file.</p>
  
  <pre><code>&lt;script&gt;
  
  function isTouchDevice() {
        return 'ontouchstart' in window || !!(navigator.msMaxTouchPoints);
  }
  
  if(isTouchDevice()) {
     document.getElementById('touch').value = 1;
  } else {
     document.getElementById('touch').value = 0;
  }
  
  
  &lt;/script&gt;
  &lt;body&gt;
     &lt;input type='hidden' id='touch' value='0'/&gt;
  
  &lt;?php
  
    // This is where i need help 
    // and yes...i know the code below is not proper php its just what i want to achieve. 
  
     -- if ([touch screen is true]) then....
          include ("sections/blog_widget_mobile.php");
        else {
          include ("sections/blog_widget.php");
        }
  
  ?&gt;
  </code></pre>
  
  <p>I can't find a php version of the javascript function isTouchDevice(), so i thought the best way would be to apply a value to an html element and try to retrieve that value via php. </p>
  
  <p>Can anyone help?</p>
  
  <p>Any advice is appreciated</p>