codeigniter CodeIgniter URI Segment Get last and before last URI segment

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Example

Get last segment

echo end($this->uri->segment_array()); //it will print others

Get before last segment

echo $this->uri->segment(count($this->uri->segment_array())-1); //it will print how-can-i-do-this

More info: [http://stackoverflow.com/questions/9221164/code-igniter-get-before-last-uri-segment][1]



Got any codeigniter Question?