0

I get an error when I try to check if a query taken from the url equals something.

Error: syntax error, unexpected T_IS_EQUAL, expecting ',' or ')'

if (isset($_GET['lang'] == 'eng')) {
    echo 'ENG';
}else if (isset($_GET['lang'] == 'alb')) {
    echo 'ALB';
}else {
    echo 'MKD';
}

Am I doing something wrong?

Thanks

Nikk
  • 6,581
  • 8
  • 36
  • 69

1 Answers1

3

You can not use == and isset to gether:

if (isset($_GET['lang']) && $_GET['lang']=='eng') {
    echo 'ENG';
}
else if (isset($_GET['lang']) && $_GET['lang'] == 'alb') {
    echo 'ALB';
}else {
    echo 'MKD';
}
Ronak Patel
  • 5,341
  • 9
  • 54
  • 129