title: How to generate a new URL using current_url in codeigniter
body: <p>I am trying to use the current_url() function in codeigniter but not sure how to manipulate this data.  I understand I can echo out the current_url() but how do I take each of the segments and use to generate a new URL?</p>
  
  <p>I am trying to take pieces of the current page and use to generate a new URL with adding in new variable data.</p>
  
  <p>I have never worked with current_url(); before, so not sure what to do.  Lets say my user is on a filters page and has 2 variables to filter their results (neighborhood and category).  If the user clicks on a neighborhood, how would I structure the hyperlink to pull the current url variable for the category and then insert the variable for neighborhood?</p>
  
  <p>My URLs look something like:
  mydomain.com/ny/find/$neighborhood/$category</p>
  
  <pre><code>   Breakdown:
     ny = controller
     find = function
     param1 = $neighborhood
     param2 = $category
  </code></pre>
  
  <p>Any help would be much appreciated...</p>