Welcome Guest, Not a member yet? Register   Sign In
switch on input->post()
#2

[eluser]erik.brannstrom[/eluser]
I don't see why you don't just use a regular if-else statement since you only have two alternatives.

Anyway, the following should work, though you should be aware that switch uses loose comparison (== and not ===), so a value of 0 or FALSE would also be considered to be NULL.

Code:
switch($this->input->post('asd')) {
  case NULL:
    //i do this
    break;
  default:
    //i do this other
}


Messages In This Thread
switch on input->post() - by El Forum - 04-11-2010, 12:53 PM
switch on input->post() - by El Forum - 04-11-2010, 02:09 PM
switch on input->post() - by El Forum - 04-11-2010, 03:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB