php if/else rewritten