CodeIgniter Forums
Missing URI Segment Check - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Missing URI Segment Check (/thread-60905.html)

Missing URI Segment Check - El Forum - 07-28-2014

Hello fellow CodeIgniters,

I'm just picking up CodeIgniter once again after a few years out from programming.

I'm currently using the following URL

http://[local domain]/welcome/index/http/404

and pulling my following values
$this->uri->segment(3); = http
$this->uri->segment(4); = 404

However if I remove http and end up with the following url: http://[local domain]/welcome/index/http/404
I want to still be able to pick up the same values ie (
$this->uri->segment(3); = (NULL/FALSE or what ever)
$this->uri->segment(4); = 404

Same applies if I miss segment 4 but have segment 3 filled out (
$this->uri->segment(3); = http
$this->uri->segment(4); = (NULL/FALSE or what ever)

Catch my drift? What is the best way to do this?