Welcome Guest, Not a member yet? Register   Sign In
URL / Controler realted
#6

[eluser]xwero[/eluser]
if you have other words that are also valid you could do something like this
Code:
$thirdsegment = array('location', 'someword', 'anotherword');
$result = array_search($this->uri->segment(3),$thirdsegement);
if(is_numeric($result))
{
   // valid third section
   switch($result)
   {
     case 0: /* do something */; break;
     case 1: /* do something */; break;
     case 2: /* do something */; break;
   }
}
else
{
  // not valid third section
}

edit : the check for no third segment has to happen before you start checking for the segment value.


Messages In This Thread
URL / Controler realted - by El Forum - 12-26-2007, 09:35 AM
URL / Controler realted - by El Forum - 12-26-2007, 09:42 AM
URL / Controler realted - by El Forum - 12-26-2007, 04:20 PM
URL / Controler realted - by El Forum - 12-26-2007, 04:21 PM
URL / Controler realted - by El Forum - 12-26-2007, 04:27 PM
URL / Controler realted - by El Forum - 12-26-2007, 04:31 PM
URL / Controler realted - by El Forum - 12-26-2007, 04:49 PM
URL / Controler realted - by El Forum - 12-26-2007, 05:07 PM
URL / Controler realted - by El Forum - 12-26-2007, 07:15 PM
URL / Controler realted - by El Forum - 12-26-2007, 11:21 PM
URL / Controler realted - by El Forum - 12-27-2007, 01:12 AM
URL / Controler realted - by El Forum - 12-27-2007, 09:01 AM
URL / Controler realted - by El Forum - 12-27-2007, 09:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB