获取最后一个和最后一个 URI 段之前

获取最后一段

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

在最后一段之前获取

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

更多信息:[ http://stackoverflow.com/questions/9221164/code-igniter-get-before-last-uri-segment] [1 ]