title: Codeigniter variable-length parameter list
body: <p>I'm making a tutorialsystem with Codeigniter, but I'm a bit stuck with using subcategories for my tutorials.</p>
  
  <p>The URL-structure is like this: /tutorials/test/123/this-is-a-tutorial</p>
  
  <ul>
  <li>tutorials is the controller</li>
  <li>test is a shortcode for the category</li>
  <li>123 is the tutorial ID (used in the SQL query)</li>
  <li>this-is-a-tutorial is just a slug to prettify the URL</li>
  </ul>
  
  <p>What I do is passing the category as a first parameter and the ID as a second parameter to my controller function:</p>
  
  <pre><code>public function tutorial($category = NULL, $tutorial_id = NULL);
  </code></pre>
  
  <p>Now, if I want subcategories (unlimited depth), like: /tutorials/test/test2/123/another-tutorial. How would I implement this?</p>
  
  <p>Thanks!</p>