[eluser]xwero[/eluser]
You could extend the uri library
Code:
<?php
class MY_URI extends CI_URI
{
function MY_URI()
{
parent::CI_URI();
}
function slice($string = null,$segments = null)
{
if(is_null($string))
{
return false;
}
$search = array_search($string,$this->router->segments);
if(is_numeric($search))
{
if(is_null($segments))
{
return array_slice($this->router->segments,$search);
}
elseif(is_numeric($segments))
{
return array_slice($this->router->segments,$search,$segments);
}
}
}
}
?>
the controller code then would be
Code:
$this->uri->slice('keyword',1); // returns array with one value
$this->uri->slice('keyword'); // returns array with all values after the string
To be complete there should be a rslice too.