Array
(
[username] => 1
[password] => 1
[email] => 1
)
i have an array with following data.
i have a switch statement to match the error as follows
switch ($this->errors['username']) {
case "-1":
$this->error_msg['username'] = 'Enter a Username';
break;
case '-2':
$this->error_msg['username'] =
'Username can contain only <b><i>Alpha Numeric Charaters</i></b>';
break;
case '-3':
$this->error_msg['username'] =
'Username should be <b><i>Min 3 Characters</i></b>';
break;
default:
break;
}
Since my data is 1 and theres an case -1 its printing the same. How can i match it to -1