I found on stackOverflow that I get the last segment can be found like this:
end($this->uri->segment_array());
There is a work around from the statement above to get the before last segment?
I'm not asking about
$this->uri->uri_to_assoc(n)
or
$this->uri->segment(n)
Thank you.
Here's the segment before.
$secondLastKey = count($this->uri->segment_array())-1;
$this->uri->segment($secondLastKey);