title: Pass single OR multiple URI segments to function (code igniter)
body: <p>Currently I have this url to view an image from the db (codeigniter) <code>domain.com/view/id</code></p>
  
  <p>I'd like to be able to accept multiple ids comma separated <code>domain.com/view/id,id,id</code></p>
  
  <p>Any idea how to go about it? Thanks</p>
  
  <hr>
  
  <p>view controller part:</p>
  
  <pre><code>function view() {
      $id = alphaID($this-&gt;uri-&gt;segment(1) ,true);
  
      $this-&gt;load-&gt;model('Site_model');
      if($query = $this-&gt;Site_model-&gt;get_images($id)) {
          $data['records'] = $query;
      }   
      $this-&gt;load-&gt;view('view', $data);
  
  
  }
  
  &lt;?php if(isset($records)) : foreach($records as $row) : ?&gt;
      &lt;?php if($row-&gt;alpha_id == $this-&gt;uri-&gt;segment(1)): ?&gt;
          &lt;h1&gt;&lt;?php echo $row-&gt;alpha_id.$row-&gt;file_ext; ?&gt;&lt;/h1&gt;
      &lt;?php endif; ?&gt;
      &lt;?php endforeach; ?&gt;
  &lt;?php endif; ?&gt;
  </code></pre>