reenadak

IP validator

Feb 20th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1.     /*
  2.     - IP validator
  3.     - Ensures an IP address is in the valid format of example 127.0.0.1
  4.    
  5.     $ip     - The IP address to validate
  6.     */
  7.    
  8.     function validateIP($ip) {
  9.         if (filter_var($ip, FILTER_VALIDATE_IP))
  10.             return true;
  11.         else
  12.             return false;
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment