title: Get id from url in a variable PHP
body: <p>Have a problem to get the id from the URL in a variable!</p>
  
  <p>The Url is like this <code>domain.com/article/1123/</code></p>
  
  <p>and its like dynamic with many id's</p>
  
  <p>I want to save the 1123 in a variable please help!</p>
  
  <p>a tried it with this</p>
  
  <pre><code>    if(isset($_GET['id']) &amp;&amp; !preg_match('/[0-9]{4}[a-zA-Z]{0,2}/', $_GET['id'], $id)) { 
          require_once('404.php'); 
      } else { 
          $id = $_GET['id']; 
      }
  </code></pre>