CodeIgniter URI Segment
$this->uri->segment(n)
Segment function allow you to retrieve a specific segment form URI string where n is a segment number.Segments are numbered from left to right.
http://localhost/project/index.php/my_controller/show_my_id/1
echo $this->uri->segment(1);//this will print my_controller
echo $this->uri->segment(2);// this will print show_my_id
echo $this->uri->segment(3);// this will print 1