[PHP] Get rid of multi-layered if-else nested conditions