In CodeIgniter, you can get the value of the id from the URL by using the function $this->uri->segment(n), where n is the position of the segment you want to retrieve.