PHP input validation Class