Tutorial by Examples

For example, please consider the following URI: http://stackoverflow.com/questions/some-number/how-can-i-do-this/others Segment allows to retrieve a specific segment form URI string where n is a segment number. Segments are numbered from left to right. For example, the following code: $this-&gt...
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-b...

Page 1 of 1