Issue
I want to check if an entered input is a valid IP address or not. I would like a specific function that will help me validate a users input.
Solution
filter_var($ip, FILTER_VALIDATE_IP)
Example:
if (filter_var($ip, FILTER_VALIDATE_IP)) {echo 'Valid IP';}
else {echo 'Not Valid IP';}
Answered By - deceze Answer Checked By - Cary Denson (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.