CodeIgniter Forums
$this->uri->segment(1) - speed ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: $this->uri->segment(1) - speed ? (/showthread.php?tid=15092)



$this->uri->segment(1) - speed ? - El Forum - 01-26-2009

[eluser]matt2012[/eluser]
I've a little stats plugin that I use.

I was wondering how efficient it was to run the code below
or whether I would be better finding out how many segments there
were and calling $CI->uri->segment only for those. This code
is run on every page so its impact is important.



Code:
'seg1' => $CI->uri->segment(1),
'seg2' => $CI->uri->segment(2),
'seg3' => $CI->uri->segment(3),
'seg4' => $CI->uri->segment(4),
'seg5' => $CI->uri->segment(5),
'seg6' => $CI->uri->segment(6),
'seg7' => $CI->uri->segment(7),
'seg8' => $CI->uri->segment(8),