Simplified PHP if loop