if ($x == 0) {
// Do 1....
}
elseif ($x!=0) {
// Do 2.....
}
else {
//
// :)
//
}
Source: https://habr.com/ru/post/39638/