How to validate a variable is IP address in Php?