/ Published in: PHP
This code demonstrates a simple way to validate IP address using preg_match() PHP function. This is a very simple code, that allows you to perform this task quickly with a minimum lines of code.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $ip_address = '127.0.0.1'; echo 'IP address is valid!'; }else{ echo 'IP address is NOT valid!'; } ?>
URL: http://www.apphp.com/index.php?snippet=php-validate-ip-address