title: How to determine if the device is Mobile or Desktop?
body: <p>I have read a lot of articles and looked for solutions to detect mobile devices. Actually a came across <a href="https://github.com/serbanghita/mobile-detect" rel="nofollow">https://github.com/serbanghita/mobile-detect</a> but it's a quite massive php class.</p>
  
  <p>I actually want a very simple solution. I want to determine if the user's browser is Mobile/iPad/etc OR Desktop. So I want something like this:</p>
  
  <pre><code>&lt;?php
  
  require('detector.php');
  
  if(isMobile() === true)
  {
     header('mobile.php');
     exit();
  }
  else
  {
     header('desktop.php');
     exit();
  }
  </code></pre>
  
  <p>?></p>
  
  <p>A very simple solution is needed which I can place to any page without installing composer or any php framework.</p>
  
  <p>How is this actually possible?</p>