獲取最後一個和最後一個 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 ]