<?php function phone_validate($tel, $champs) { $regex = "/^([2-9][0-9]{2})[2-9][0-9]{2}-[0-9]{4}/i"; if(preg_match($regex, $tel) != 1) { return "Le champs '$champs' est invalide"; } return true; } ?> |
<?php function phone_validate($tel, $champs) { $regex = "/^([2-9][0-9]{2})[2-9][0-9]{2}-[0-9]{4}/i"; if(preg_match($regex, $tel) != 1) { return "Le champs '$champs' est invalide"; } return true; } ?> |